# HG changeset patch # User reimar # Date 1235296318 0 # Node ID aae80543bc6e0321aea44cdf33624794bbe0a78d # Parent b595a8a599676d6b06257a2fee63ef12d2473ca7 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. diff -r b595a8a59967 -r aae80543bc6e h264.c --- 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<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<sps.log2_max_frame_num; s->current_picture_ptr->frame_num= h->prev_frame_num;