avcodec/pngenc: restore image size before copying frame
authorDmitriy <DiZNet@mail.ru>
Fri, 8 Apr 2016 10:37:20 +0000 (12:37 +0200)
committerPaul B Mahol <onemda@gmail.com>
Fri, 8 Apr 2016 10:37:20 +0000 (12:37 +0200)
Signed-off-by: Paul B Mahol <onemda@gmail.com>
libavcodec/pngenc.c

index e9e8bc2..2ee43c5 100644 (file)
@@ -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);
             }