[FFmpeg-cvslog] avutil/common: Protect GET_BYTE in GET_UTF8() by ()

Michael Niedermayer git at videolan.org
Wed Jan 13 03:10:56 CET 2016


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Wed Jan 13 02:33:48 2016 +0100| [9ca64c31d2f435646fead0cc89207e4c63759ac5] | committer: Michael Niedermayer

avutil/common: Protect GET_BYTE in GET_UTF8() by ()

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavutil/common.h |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavutil/common.h b/libavutil/common.h
index f3276a2..f9766ad 100644
--- a/libavutil/common.h
+++ b/libavutil/common.h
@@ -356,13 +356,13 @@ static av_always_inline av_const int av_parity_c(uint32_t v)
  * to prevent undefined results.
  */
 #define GET_UTF8(val, GET_BYTE, ERROR)\
-    val= GET_BYTE;\
+    val= (GET_BYTE);\
     {\
         uint32_t top = (val & 128) >> 1;\
         if ((val & 0xc0) == 0x80 || val >= 0xFE)\
             ERROR\
         while (val & top) {\
-            int tmp= GET_BYTE - 128;\
+            int tmp= (GET_BYTE) - 128;\
             if(tmp>>6)\
                 ERROR\
             val= (val<<6) + tmp;\



More information about the ffmpeg-cvslog mailing list