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

reimar subversion
Sun Feb 22 10:51:58 CET 2009


Author: reimar
Date: Sun Feb 22 10:51:58 2009
New Revision: 17520

Log:
Check return value of frame_start(), this avoids a crash if AVCodecContext::get_buffer failed.
Not sure if returning -1 is the best possible solution but at least avoids the crash.

Modified:
   trunk/libavcodec/h264.c

Modified: trunk/libavcodec/h264.c
==============================================================================
--- trunk/libavcodec/h264.c	Sun Feb 22 10:42:56 2009	(r17519)
+++ trunk/libavcodec/h264.c	Sun Feb 22 10:51:58 2009	(r17520)
@@ -3792,7 +3792,8 @@ static int decode_slice_header(H264Conte
         while(h->frame_num !=  h->prev_frame_num &&
               h->frame_num != (h->prev_frame_num+1)%(1<<h->sps.log2_max_frame_num)){
             av_log(NULL, AV_LOG_DEBUG, "Frame num gap %d %d\n", h->frame_num, h->prev_frame_num);
-            frame_start(h);
+            if (frame_start(h) < 0)
+                return -1;
             h->prev_frame_num++;
             h->prev_frame_num %= 1<<h->sps.log2_max_frame_num;
             s->current_picture_ptr->frame_num= h->prev_frame_num;




More information about the ffmpeg-cvslog mailing list