[FFmpeg-cvslog] avcodec/h264_parser: fix order of operations

Michael Niedermayer git at videolan.org
Sun Oct 20 00:15:46 CEST 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Oct 19 23:44:34 2013 +0200| [9c0fe487c755c19da48f4cc76aba1ac0931b5863] | committer: Michael Niedermayer

avcodec/h264_parser: fix order of operations

Fixes CID1108576

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavcodec/h264_parser.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/h264_parser.c b/libavcodec/h264_parser.c
index 11e6e13..2bf6277 100644
--- a/libavcodec/h264_parser.c
+++ b/libavcodec/h264_parser.c
@@ -249,7 +249,7 @@ static inline int parse_nal_units(AVCodecParserContext *s,
         case NAL_SLICE:
         case NAL_IDR_SLICE:
             // Do not walk the whole buffer just to decode slice header
-            if (state & 0x1f == NAL_IDR_SLICE || (state >> 5) & 0x3 == 0) {
+            if ((state & 0x1f) == NAL_IDR_SLICE || ((state >> 5) & 0x3) == 0) {
                 /* IDR or disposable slice
                  * No need to decode many bytes because MMCOs shall not be present. */
                 if (src_length > 60)



More information about the ffmpeg-cvslog mailing list