diff options
author | Paul B Mahol <onemda@gmail.com> | 2016-04-08 12:45:40 +0200 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2016-04-08 12:45:40 +0200 |
commit | 1490682bcb0fe359e05b85bb7198bb87be686054 (patch) | |
tree | fce661da902ed1b15717ee1efb458da07cb2ac0e /libavcodec | |
parent | c3320a51df2bed022369057d4411695aad0974dc (diff) | |
download | ffmpeg-1490682bcb0fe359e05b85bb7198bb87be686054.tar.gz |
avcodec/pngenc: check return value of av_frame_copy()
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/pngenc.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libavcodec/pngenc.c b/libavcodec/pngenc.c index 2ee43c52a3..00c830e6eb 100644 --- a/libavcodec/pngenc.c +++ b/libavcodec/pngenc.c @@ -768,7 +768,9 @@ static int apng_encode_frame(AVCodecContext *avctx, const AVFrame *pict, if (last_fctl_chunk.dispose_op != APNG_DISPOSE_OP_PREVIOUS) { diffFrame->width = pict->width; diffFrame->height = pict->height; - av_frame_copy(diffFrame, s->last_frame); + ret = av_frame_copy(diffFrame, s->last_frame); + if (ret < 0) + goto fail; if (last_fctl_chunk.dispose_op == APNG_DISPOSE_OP_BACKGROUND) { for (y = last_fctl_chunk.y_offset; y < last_fctl_chunk.y_offset + last_fctl_chunk.height; ++y) { @@ -782,7 +784,9 @@ static int apng_encode_frame(AVCodecContext *avctx, const AVFrame *pict, diffFrame->width = pict->width; diffFrame->height = pict->height; - av_frame_copy(diffFrame, s->prev_frame); + ret = av_frame_copy(diffFrame, s->prev_frame); + if (ret < 0) + goto fail; } // Do inverse blending |