[FFmpeg-cvslog] lavu/common: add warning to GET_UTF8 doxy

Stefano Sabatini git at videolan.org
Fri Oct 4 16:41:20 CEST 2013


ffmpeg | branch: master | Stefano Sabatini <stefasab at gmail.com> | Thu Oct  3 00:32:26 2013 +0200| [719b4eef5db7c2452229b4a801722281d5f5f874] | committer: Stefano Sabatini

lavu/common: add warning to GET_UTF8 doxy

Should prevent wrong uses, or at least decrease their chance.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=719b4eef5db7c2452229b4a801722281d5f5f874
---

 libavutil/common.h |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavutil/common.h b/libavutil/common.h
index 9f0f998..b1203ad 100644
--- a/libavutil/common.h
+++ b/libavutil/common.h
@@ -295,6 +295,11 @@ static av_always_inline av_const int av_popcount64_c(uint64_t x)
  *                 input, this could be *ptr++.
  * @param ERROR    Expression to be evaluated on invalid input,
  *                 typically a goto statement.
+ *
+ * @warning ERROR should not contain a loop control statement which
+ * could interact with the internal while loop, and should force an
+ * exit from the macro code (e.g. through a goto or a return) in order
+ * to prevent undefined results.
  */
 #define GET_UTF8(val, GET_BYTE, ERROR)\
     val= GET_BYTE;\



More information about the ffmpeg-cvslog mailing list