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); }