summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-11-25 14:24:08 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-11-25 22:46:33 +0100
commit0c5af908c11a4f2bdc7d8d45209155c6d72d6520 (patch)
tree1bf64c34eec3c242283ff9960648aed036d714a9
parente0bc798ce5a19952317c87f6e9e551223e3a0159 (diff)
avcodec/pngdec: Mark damaged frames as finished
Fixes the deadlock reported in ticket #10071. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
-rw-r--r--libavcodec/pngdec.c6
1 files 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);