Browse Source

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
tags/n0.8
Michael Niedermayer 15 years ago
parent
commit
013291501f
1 changed files with 8 additions and 0 deletions
  1. +8
    -0
      libavcodec/4xm.c

+ 8
- 0
libavcodec/4xm.c View File

@@ -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;


Loading…
Cancel
Save