mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
Avoid segfaulting if the swscale context cannot be allocated
Originally committed as revision 5936 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
e7268d51af
commit
0b50ac8a0f
4
ffmpeg.c
4
ffmpeg.c
@ -1665,6 +1665,10 @@ static int av_encode(AVFormatContext **output_files,
|
|||||||
codec->height - (frame_padtop + frame_padbottom),
|
codec->height - (frame_padtop + frame_padbottom),
|
||||||
codec->pix_fmt,
|
codec->pix_fmt,
|
||||||
sws_flags, NULL, NULL, NULL);
|
sws_flags, NULL, NULL, NULL);
|
||||||
|
if (ost->img_resample_ctx == NULL) {
|
||||||
|
fprintf(stderr, "Cannot get resampling context\n");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
ost->resample_height = icodec->height - (frame_topBand + frame_bottomBand);
|
ost->resample_height = icodec->height - (frame_topBand + frame_bottomBand);
|
||||||
}
|
}
|
||||||
ost->encoding_needed = 1;
|
ost->encoding_needed = 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user