summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>2009-02-22 09:51:58 +0000
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>2009-02-22 09:51:58 +0000
commit66e6038cf1459304ed92305b8f3e61e2f45e8fc7 (patch)
tree5c02e221c4f1be027688ab93782645b064d742b7 /libavcodec
parent67d44b84c1fd2c7e1f873741dcd6d68a3b123b3e (diff)
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. Originally committed as revision 17520 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/h264.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 372adb931b..5339ed017e 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -3792,7 +3792,8 @@ static int decode_slice_header(H264Context *h, H264Context *h0){
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;