1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avcodec/pngenc: restore image size before copying frame

Signed-off-by: Paul B Mahol <onemda@gmail.com>
This commit is contained in:
Dmitriy 2016-04-08 12:37:20 +02:00 committed by Paul B Mahol
parent ae8a13c560
commit c3320a51df

View File

@ -766,6 +766,8 @@ static int apng_encode_frame(AVCodecContext *avctx, const AVFrame *pict,
// Do disposal // Do disposal
if (last_fctl_chunk.dispose_op != APNG_DISPOSE_OP_PREVIOUS) { 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); av_frame_copy(diffFrame, s->last_frame);
if (last_fctl_chunk.dispose_op == APNG_DISPOSE_OP_BACKGROUND) { 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) if (!s->prev_frame)
continue; continue;
diffFrame->width = pict->width;
diffFrame->height = pict->height;
av_frame_copy(diffFrame, s->prev_frame); av_frame_copy(diffFrame, s->prev_frame);
} }