Commit c3320a51 authored by Dmitriy's avatar Dmitriy Committed by Paul B Mahol

avcodec/pngenc: restore image size before copying frame

Signed-off-by: 's avatarPaul B Mahol <onemda@gmail.com>
parent ae8a13c5
......@@ -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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment