Commit 2de28abb authored by Michael Niedermayer's avatar Michael Niedermayer

10l (segfault fix)

Originally committed as revision 3029 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent a4d36c11
...@@ -1422,16 +1422,17 @@ static int av_encode(AVFormatContext **output_files, ...@@ -1422,16 +1422,17 @@ static int av_encode(AVFormatContext **output_files,
ost->padleft = frame_padleft; ost->padleft = frame_padleft;
ost->padbottom = frame_padbottom; ost->padbottom = frame_padbottom;
ost->padright = frame_padright; ost->padright = frame_padright;
avcodec_get_frame_defaults(&ost->pict_tmp);
if( avpicture_alloc( (AVPicture*)&ost->pict_tmp, PIX_FMT_YUV420P, if( avpicture_alloc( (AVPicture*)&ost->pict_tmp, PIX_FMT_YUV420P,
codec->width, codec->height ) ) codec->width, codec->height ) )
goto fail; goto fail;
} else { } else {
ost->video_resample = 1; ost->video_resample = 1;
ost->video_crop = 0; // cropping is handled as part of resample ost->video_crop = 0; // cropping is handled as part of resample
avcodec_get_frame_defaults(&ost->pict_tmp);
if( avpicture_alloc( (AVPicture*)&ost->pict_tmp, PIX_FMT_YUV420P, if( avpicture_alloc( (AVPicture*)&ost->pict_tmp, PIX_FMT_YUV420P,
codec->width, codec->height ) ) codec->width, codec->height ) )
goto fail; goto fail;
avcodec_get_frame_defaults(&ost->pict_tmp);
ost->img_resample_ctx = img_resample_full_init( ost->img_resample_ctx = img_resample_full_init(
ost->st->codec.width, ost->st->codec.height, ost->st->codec.width, ost->st->codec.height,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment