diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-01-16 22:08:34 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-01-16 22:08:34 +0000 |
commit | 013291501fac5162e93bbcc9783e5e25d9cd2ab3 (patch) | |
tree | b44b7dbbd53baedfca589a40f8b97ea33c6e4d91 /libavcodec/4xm.c | |
parent | 5fbf2b3f66d0f16b24fa51b4b75aae29609b9fa5 (diff) | |
download | ffmpeg-013291501fac5162e93bbcc9783e5e25d9cd2ab3.tar.gz |
Allocate last picture for 4xm pfrm if its not allocated.
Fixes segfault and issue2527
Originally committed as revision 26397 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/4xm.c')
-rw-r--r-- | libavcodec/4xm.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libavcodec/4xm.c b/libavcodec/4xm.c index 23e8ca4420..30c4c5919f 100644 --- a/libavcodec/4xm.c +++ b/libavcodec/4xm.c @@ -791,6 +791,14 @@ static int decode_frame(AVCodecContext *avctx, if(decode_i_frame(f, buf, frame_size) < 0) return -1; }else if(frame_4cc == AV_RL32("pfrm") || frame_4cc == AV_RL32("pfr2")){ + if(!f->last_picture.data[0]){ + f->last_picture.reference= 1; + if(avctx->get_buffer(avctx, &f->last_picture) < 0){ + av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); + return -1; + } + } + p->pict_type= FF_P_TYPE; if(decode_p_frame(f, buf, frame_size) < 0) return -1; |