diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2015-08-21 02:02:05 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2015-11-12 02:55:45 +0100 |
commit | a8c8a2f3f4aa6489c117f00bc2d15f09db935809 (patch) | |
tree | 5a88ad8e7f90d405c9554bdf053cdf08e7c19fc1 /ffmpeg.c | |
parent | 485372e91cc23978cf193cb141169ceb139b22fd (diff) | |
download | ffmpeg-a8c8a2f3f4aa6489c117f00bc2d15f09db935809.tar.gz |
ffmpeg: check avpicture_fill() return value
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 15ff3f3fdfc788c0e4e584badd7ec300abfbd716)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'ffmpeg.c')
-rw-r--r-- | ffmpeg.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -1823,7 +1823,11 @@ static void do_streamcopy(InputStream *ist, OutputStream *ost, const AVPacket *p if (ost->st->codec->codec_type == AVMEDIA_TYPE_VIDEO && (of->ctx->oformat->flags & AVFMT_RAWPICTURE)) { /* store AVPicture in AVPacket, as expected by the output format */ - avpicture_fill(&pict, opkt.data, ost->st->codec->pix_fmt, ost->st->codec->width, ost->st->codec->height); + int ret = avpicture_fill(&pict, opkt.data, ost->st->codec->pix_fmt, ost->st->codec->width, ost->st->codec->height); + if (ret < 0) { + av_log(NULL, AV_LOG_FATAL, "avpicture_fill failed\n"); + exit_program(1); + } opkt.data = (uint8_t *)&pict; opkt.size = sizeof(AVPicture); opkt.flags |= AV_PKT_FLAG_KEY; |