Mercurial > libavcodec.hg
comparison h264.c @ 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 | e65778184ded |
children | 15a3df8c01fd |
comparison
equal
deleted
inserted
replaced
9003:b595a8a59967 | 9004:aae80543bc6e |
---|---|
3790 | 3790 |
3791 if(h0->current_slice == 0){ | 3791 if(h0->current_slice == 0){ |
3792 while(h->frame_num != h->prev_frame_num && | 3792 while(h->frame_num != h->prev_frame_num && |
3793 h->frame_num != (h->prev_frame_num+1)%(1<<h->sps.log2_max_frame_num)){ | 3793 h->frame_num != (h->prev_frame_num+1)%(1<<h->sps.log2_max_frame_num)){ |
3794 av_log(NULL, AV_LOG_DEBUG, "Frame num gap %d %d\n", h->frame_num, h->prev_frame_num); | 3794 av_log(NULL, AV_LOG_DEBUG, "Frame num gap %d %d\n", h->frame_num, h->prev_frame_num); |
3795 frame_start(h); | 3795 if (frame_start(h) < 0) |
3796 return -1; | |
3796 h->prev_frame_num++; | 3797 h->prev_frame_num++; |
3797 h->prev_frame_num %= 1<<h->sps.log2_max_frame_num; | 3798 h->prev_frame_num %= 1<<h->sps.log2_max_frame_num; |
3798 s->current_picture_ptr->frame_num= h->prev_frame_num; | 3799 s->current_picture_ptr->frame_num= h->prev_frame_num; |
3799 execute_ref_pic_marking(h, NULL, 0); | 3800 execute_ref_pic_marking(h, NULL, 0); |
3800 } | 3801 } |