From c3320a51df2bed022369057d4411695aad0974dc Mon Sep 17 00:00:00 2001 From: Dmitriy Date: Fri, 8 Apr 2016 12:37:20 +0200 Subject: [PATCH] avcodec/pngenc: restore image size before copying frame Signed-off-by: Paul B Mahol --- libavcodec/pngenc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libavcodec/pngenc.c b/libavcodec/pngenc.c index e9e8bc2782..2ee43c52a3 100644 --- a/libavcodec/pngenc.c +++ b/libavcodec/pngenc.c @@ -766,6 +766,8 @@ static int apng_encode_frame(AVCodecContext *avctx, const AVFrame *pict, // Do disposal 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); if (last_fctl_chunk.dispose_op == APNG_DISPOSE_OP_BACKGROUND) { @@ -778,6 +780,8 @@ static int apng_encode_frame(AVCodecContext *avctx, const AVFrame *pict, if (!s->prev_frame) continue; + diffFrame->width = pict->width; + diffFrame->height = pict->height; av_frame_copy(diffFrame, s->prev_frame); }