]> git.sesse.net Git - ffmpeg/commitdiff
If consumed does not match nalsize, favor nalsize.
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 13 Mar 2008 01:49:19 +0000 (01:49 +0000)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 13 Mar 2008 01:49:19 +0000 (01:49 +0000)
Fixes issue385.

Originally committed as revision 12430 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavcodec/h264.c

index 014a292359bb3211ec1848e1077ba8a4ea50e735..e945774078341f60ec44985e89529613ea8561b8 100644 (file)
@@ -7495,8 +7495,10 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size){
             av_log(h->s.avctx, AV_LOG_DEBUG, "NAL %d at %d/%d length %d\n", hx->nal_unit_type, buf_index, buf_size, dst_length);
         }
 
-        if (h->is_avc && (nalsize != consumed))
+        if (h->is_avc && (nalsize != consumed)){
             av_log(h->s.avctx, AV_LOG_ERROR, "AVC: Consumed only %d bytes instead of %d\n", consumed, nalsize);
+            consumed= nalsize;
+        }
 
         buf_index += consumed;