[FFmpeg-cvslog] r11214 - trunk/libavcodec/h264.c

heydowns subversion
Fri Dec 14 06:37:23 CET 2007


Author: heydowns
Date: Fri Dec 14 06:37:23 2007
New Revision: 11214

Log:
Make h264 decoder conform to requirements of mpegvideo's MPV_frame_start.
Namely, that it should not be called if you are starting to decode a B
frame without any reference pictures.
Prevents an endless allocation cycle in MPV_frame_start that will end in
picture buffer overflow and abort.
Fixes roundup issue 216.



Modified:
   trunk/libavcodec/h264.c

Modified: trunk/libavcodec/h264.c
==============================================================================
--- trunk/libavcodec/h264.c	(original)
+++ trunk/libavcodec/h264.c	Fri Dec 14 06:37:23 2007
@@ -3911,6 +3911,11 @@ static int decode_slice_header(H264Conte
     h->slice_type= slice_type;
 
     s->pict_type= h->slice_type; // to make a few old func happy, it's wrong though
+    if (s->pict_type == B_TYPE && s->last_picture_ptr == NULL) {
+        av_log(h->s.avctx, AV_LOG_ERROR,
+               "B picture before any references, skipping\n");
+        return -1;
+    }
 
     pps_id= get_ue_golomb(&s->gb);
     if(pps_id>=MAX_PPS_COUNT){




More information about the ffmpeg-cvslog mailing list