[FFmpeg-cvslog] avcodec/pngdec: Mark damaged frames as finished

Andreas Rheinhardt git at videolan.org
Fri Nov 25 23:50:29 EET 2022


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Fri Nov 25 14:24:08 2022 +0100| [0c5af908c11a4f2bdc7d8d45209155c6d72d6520] | committer: Andreas Rheinhardt

avcodec/pngdec: Mark damaged frames as finished

Fixes the deadlock reported in ticket #10071.

Reviewed-by: Paul B Mahol <onemda at gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>

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

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

diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c
index 8080094d65..f1cad26c52 100644
--- a/libavcodec/pngdec.c
+++ b/libavcodec/pngdec.c
@@ -1362,8 +1362,10 @@ exit_loop:
         return 0;
     }
 
-    if (percent_missing(s) > avctx->discard_damaged_percentage)
-        return AVERROR_INVALIDDATA;
+    if (percent_missing(s) > avctx->discard_damaged_percentage) {
+        ret = AVERROR_INVALIDDATA;
+        goto fail;
+    }
 
     if (s->bits_per_pixel <= 4)
         handle_small_bpp(s, p);



More information about the ffmpeg-cvslog mailing list