]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/h264_parse: Clear ref_list[1] if only [0] is used
authorMichael Niedermayer <michael@niedermayer.cc>
Fri, 8 Feb 2019 10:04:54 +0000 (11:04 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Fri, 8 Feb 2019 11:00:59 +0000 (12:00 +0100)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/h264_parse.c

index a42cc299ffbaf51286cbc7d5a9a7da33637fd62e..a075443d173ad8e0030d4f4da1e43ac10b3e2cff 100644 (file)
@@ -253,6 +253,10 @@ int ff_h264_parse_ref_count(int *plist_count, int ref_count[2],
             ref_count[0] = ref_count[1] = 0;
             *plist_count = 0;
             goto fail;
+        } else if (ref_count[1] - 1 > max[1]) {
+            av_log(logctx, AV_LOG_DEBUG, "reference overflow %u > %u \n",
+                   ref_count[1] - 1, max[1]);
+            ref_count[1] = 0;
         }
 
     } else {