diff mbox series

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

Message ID AS8P250MB0744837EF55490C9FCEF76D98F0E9@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM
State Accepted
Commit 0c5af908c11a4f2bdc7d8d45209155c6d72d6520
Headers show
Series [FFmpeg-devel] avcodec/pngdec: Mark damaged frames as finished | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Andreas Rheinhardt Nov. 25, 2022, 1:33 p.m. UTC
Fixes the deadlock reported in ticket #10071.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/pngdec.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Paul B Mahol Nov. 25, 2022, 2:25 p.m. UTC | #1
On 11/25/22, Andreas Rheinhardt <andreas.rheinhardt@outlook.com> wrote:
> Fixes the deadlock reported in ticket #10071.
>
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
>  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);
> --
> 2.34.1
>

ok

> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
>
diff mbox series

Patch

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);