]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/pngenc.c
avcodec/takdec: add code that got somehow lost in process of REing
[ffmpeg] / libavcodec / pngenc.c
index e9e8bc278208773485d0344348f56ccda284efdd..00c830e6eb0e4e80e8262b51a60634ff24bf4fe2 100644 (file)
@@ -766,7 +766,11 @@ static int apng_encode_frame(AVCodecContext *avctx, const AVFrame *pict,
 
             // Do disposal
             if (last_fctl_chunk.dispose_op != APNG_DISPOSE_OP_PREVIOUS) {
-                av_frame_copy(diffFrame, s->last_frame);
+                diffFrame->width = pict->width;
+                diffFrame->height = pict->height;
+                ret = av_frame_copy(diffFrame, s->last_frame);
+                if (ret < 0)
+                    goto fail;
 
                 if (last_fctl_chunk.dispose_op == APNG_DISPOSE_OP_BACKGROUND) {
                     for (y = last_fctl_chunk.y_offset; y < last_fctl_chunk.y_offset + last_fctl_chunk.height; ++y) {
@@ -778,7 +782,11 @@ static int apng_encode_frame(AVCodecContext *avctx, const AVFrame *pict,
                 if (!s->prev_frame)
                     continue;
 
-                av_frame_copy(diffFrame, s->prev_frame);
+                diffFrame->width = pict->width;
+                diffFrame->height = pict->height;
+                ret = av_frame_copy(diffFrame, s->prev_frame);
+                if (ret < 0)
+                    goto fail;
             }
 
             // Do inverse blending