avcodec/pngenc: restore image size before copying frame

Signed-off-by: Paul B Mahol <onemda@gmail.com>
pull/197/head
Dmitriy 9 years ago committed by Paul B Mahol
parent ae8a13c560
commit c3320a51df
  1. 4
      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);
}

Loading…
Cancel
Save