[FFmpeg-cvslog] lavc/pngdec: fix updating reference frames for APNG_DISPOSE_OP_BACKGROUND

Anton Khirnov git at videolan.org
Fri May 14 12:20:17 EEST 2021


ffmpeg | branch: release/4.4 | Anton Khirnov <anton at khirnov.net> | Sat May  8 13:02:33 2021 +0200| [e87e006121c513172995103c7c4df770a704d0d1] | committer: Anton Khirnov

lavc/pngdec: fix updating reference frames for APNG_DISPOSE_OP_BACKGROUND

They should be treated the same as APNG_DISPOSE_OP_NONE.

Broken in 5663301560.

Fixes #9184.

(cherry picked from commit aa726eaed9848bcf6f615d2d9e6e5dd6174ad570)
Signed-off-by: Anton Khirnov <anton at khirnov.net>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e87e006121c513172995103c7c4df770a704d0d1
---

 libavcodec/pngdec.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c
index f3b212d508..6aa3c1b436 100644
--- a/libavcodec/pngdec.c
+++ b/libavcodec/pngdec.c
@@ -1644,7 +1644,7 @@ static int decode_frame_apng(AVCodecContext *avctx,
     if (!(avctx->active_thread_type & FF_THREAD_FRAME)) {
         if (s->dispose_op == APNG_DISPOSE_OP_PREVIOUS) {
             ff_thread_release_buffer(avctx, &s->picture);
-        } else if (s->dispose_op == APNG_DISPOSE_OP_NONE) {
+        } else {
             ff_thread_release_buffer(avctx, &s->last_picture);
             FFSWAP(ThreadFrame, s->picture, s->last_picture);
         }
@@ -1693,8 +1693,8 @@ static int update_thread_context(AVCodecContext *dst, const AVCodecContext *src)
         pdst->hdr_state |= psrc->hdr_state;
     }
 
-    src_frame = psrc->dispose_op == APNG_DISPOSE_OP_NONE ?
-                &psrc->picture : &psrc->last_picture;
+    src_frame = psrc->dispose_op == APNG_DISPOSE_OP_PREVIOUS ?
+                &psrc->last_picture : &psrc->picture;
 
     ff_thread_release_buffer(dst, &pdst->last_picture);
     if (src_frame && src_frame->f->data[0]) {



More information about the ffmpeg-cvslog mailing list