[FFmpeg-cvslog] ffmpeg: check avpicture_fill() return value
Michael Niedermayer
git at videolan.org
Thu Nov 26 17:54:52 CET 2015
ffmpeg | branch: release/2.5 | Michael Niedermayer <michael at niedermayer.cc> | Fri Aug 21 02:02:05 2015 +0200| [60e398f280d257ac56b1a90e5bffae8cd7dad364] | committer: Michael Niedermayer
ffmpeg: check avpicture_fill() return value
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 15ff3f3fdfc788c0e4e584badd7ec300abfbd716)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=60e398f280d257ac56b1a90e5bffae8cd7dad364
---
ffmpeg.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/ffmpeg.c b/ffmpeg.c
index 43762ed..343728b 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1759,7 +1759,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;
More information about the ffmpeg-cvslog
mailing list