changeset 9004:aae80543bc6e libavcodec

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.
author reimar
date Sun, 22 Feb 2009 09:51:58 +0000
parents b595a8a59967
children e5c9a3a813ea
files h264.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/h264.c	Sun Feb 22 09:02:06 2009 +0000
+++ b/h264.c	Sun Feb 22 09:51:58 2009 +0000
@@ -3792,7 +3792,8 @@
         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;