Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH v2 1/3] avcodec/x86/vvc/vvc_alf: fix integer overflow
@ 2024-05-30 16:28 toqsxw
  2024-05-30 18:29 ` Ronald S. Bultje
  2024-05-30 18:33 ` Andreas Rheinhardt
  0 siblings, 2 replies; 7+ messages in thread
From: toqsxw @ 2024-05-30 16:28 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: James Almer, Wu Jianhua

From: Wu Jianhua <toqsxw@outlook.com>

Some tests fails with certain seeds

tests/checkasm/checkasm 2325607578 --test=vvc_alf
checkasm: using random seed 2325607578
AVX2:
    vvc_alf_filter_luma_120x20_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x24_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x28_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x32_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x36_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x40_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x44_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x48_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x52_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x56_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x60_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x64_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x68_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x72_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x76_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x80_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x84_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x88_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x92_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x96_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x100_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x104_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x108_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x112_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x116_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x120_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x124_12_avx2 (vvc_alf.c:104)
    vvc_alf_filter_luma_120x128_12_avx2 (vvc_alf.c:104)
  - vvc_alf.alf_filter   [FAILED]
  - vvc_alf.alf_classify [OK]
checkasm: 28 of 9216 tests have failed

Reported-by: James Almer <jamrial@gmail.com>
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
---
 libavcodec/x86/vvc/vvc_alf.asm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavcodec/x86/vvc/vvc_alf.asm b/libavcodec/x86/vvc/vvc_alf.asm
index 71e821c27b..f7b3e2a6cc 100644
--- a/libavcodec/x86/vvc/vvc_alf.asm
+++ b/libavcodec/x86/vvc/vvc_alf.asm
@@ -356,7 +356,8 @@ SECTION .text
 
     FILTER_VB         xq
 
-    paddw             m0, m2
+    ; sum += curr
+    paddsw             m0, m2
 
     ; clip to pixel
     CLIPW             m0, m14, m15
-- 
2.44.0.windows.1

_______________________________________________
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".

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [FFmpeg-devel] [PATCH v2 1/3] avcodec/x86/vvc/vvc_alf: fix integer overflow
  2024-05-30 16:28 [FFmpeg-devel] [PATCH v2 1/3] avcodec/x86/vvc/vvc_alf: fix integer overflow toqsxw
@ 2024-05-30 18:29 ` Ronald S. Bultje
  2024-05-31 12:02   ` Nuo Mi
  2024-05-30 18:33 ` Andreas Rheinhardt
  1 sibling, 1 reply; 7+ messages in thread
From: Ronald S. Bultje @ 2024-05-30 18:29 UTC (permalink / raw)
  To: FFmpeg development discussions and patches; +Cc: Wu Jianhua, James Almer

Hi,

On Thu, May 30, 2024 at 12:28 PM <toqsxw@outlook.com> wrote:

> From: Wu Jianhua <toqsxw@outlook.com>
>
> Some tests fails with certain seeds
>
> tests/checkasm/checkasm 2325607578 --test=vvc_alf
> checkasm: using random seed 2325607578
> AVX2:
>     vvc_alf_filter_luma_120x20_12_avx2 (vvc_alf.c:104)
>     vvc_alf_filter_luma_120x24_12_avx2 (vvc_alf.c:104)
>     vvc_alf_filter_luma_120x28_12_avx2 (vvc_alf.c:104)
>     vvc_alf_filter_luma_120x32_12_avx2 (vvc_alf.c:104)
>     vvc_alf_filter_luma_120x36_12_avx2 (vvc_alf.c:104)
>     vvc_alf_filter_luma_120x40_12_avx2 (vvc_alf.c:104)
>     vvc_alf_filter_luma_120x44_12_avx2 (vvc_alf.c:104)
>     vvc_alf_filter_luma_120x48_12_avx2 (vvc_alf.c:104)
>     vvc_alf_filter_luma_120x52_12_avx2 (vvc_alf.c:104)
>     vvc_alf_filter_luma_120x56_12_avx2 (vvc_alf.c:104)
>     vvc_alf_filter_luma_120x60_12_avx2 (vvc_alf.c:104)
>     vvc_alf_filter_luma_120x64_12_avx2 (vvc_alf.c:104)
>     vvc_alf_filter_luma_120x68_12_avx2 (vvc_alf.c:104)
>     vvc_alf_filter_luma_120x72_12_avx2 (vvc_alf.c:104)
>     vvc_alf_filter_luma_120x76_12_avx2 (vvc_alf.c:104)
>     vvc_alf_filter_luma_120x80_12_avx2 (vvc_alf.c:104)
>     vvc_alf_filter_luma_120x84_12_avx2 (vvc_alf.c:104)
>     vvc_alf_filter_luma_120x88_12_avx2 (vvc_alf.c:104)
>     vvc_alf_filter_luma_120x92_12_avx2 (vvc_alf.c:104)
>     vvc_alf_filter_luma_120x96_12_avx2 (vvc_alf.c:104)
>     vvc_alf_filter_luma_120x100_12_avx2 (vvc_alf.c:104)
>     vvc_alf_filter_luma_120x104_12_avx2 (vvc_alf.c:104)
>     vvc_alf_filter_luma_120x108_12_avx2 (vvc_alf.c:104)
>     vvc_alf_filter_luma_120x112_12_avx2 (vvc_alf.c:104)
>     vvc_alf_filter_luma_120x116_12_avx2 (vvc_alf.c:104)
>     vvc_alf_filter_luma_120x120_12_avx2 (vvc_alf.c:104)
>     vvc_alf_filter_luma_120x124_12_avx2 (vvc_alf.c:104)
>     vvc_alf_filter_luma_120x128_12_avx2 (vvc_alf.c:104)
>   - vvc_alf.alf_filter   [FAILED]
>   - vvc_alf.alf_classify [OK]
> checkasm: 28 of 9216 tests have failed
>
> Reported-by: James Almer <jamrial@gmail.com>
> Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
> ---
>  libavcodec/x86/vvc/vvc_alf.asm | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/libavcodec/x86/vvc/vvc_alf.asm
> b/libavcodec/x86/vvc/vvc_alf.asm
> index 71e821c27b..f7b3e2a6cc 100644
> --- a/libavcodec/x86/vvc/vvc_alf.asm
> +++ b/libavcodec/x86/vvc/vvc_alf.asm
> @@ -356,7 +356,8 @@ SECTION .text
>
>      FILTER_VB         xq
>
> -    paddw             m0, m2
> +    ; sum += curr
> +    paddsw             m0, m2
>
>      ; clip to pixel
>      CLIPW             m0, m14, m15
> --
> 2.44.0.windows.1
>

LGTM.

Ronald
_______________________________________________
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".

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [FFmpeg-devel] [PATCH v2 1/3] avcodec/x86/vvc/vvc_alf: fix integer overflow
  2024-05-30 16:28 [FFmpeg-devel] [PATCH v2 1/3] avcodec/x86/vvc/vvc_alf: fix integer overflow toqsxw
  2024-05-30 18:29 ` Ronald S. Bultje
@ 2024-05-30 18:33 ` Andreas Rheinhardt
  2024-05-30 19:45   ` [FFmpeg-devel] 回复: " Wu Jianhua
  2024-05-30 20:49   ` [FFmpeg-devel] " Ronald S. Bultje
  1 sibling, 2 replies; 7+ messages in thread
From: Andreas Rheinhardt @ 2024-05-30 18:33 UTC (permalink / raw)
  To: ffmpeg-devel

toqsxw@outlook.com:
> From: Wu Jianhua <toqsxw@outlook.com>
> 
> Some tests fails with certain seeds
> 
> tests/checkasm/checkasm 2325607578 --test=vvc_alf
> checkasm: using random seed 2325607578
> AVX2:
>     vvc_alf_filter_luma_120x20_12_avx2 (vvc_alf.c:104)
>     vvc_alf_filter_luma_120x24_12_avx2 (vvc_alf.c:104)
>     vvc_alf_filter_luma_120x28_12_avx2 (vvc_alf.c:104)
>     vvc_alf_filter_luma_120x32_12_avx2 (vvc_alf.c:104)
>     vvc_alf_filter_luma_120x36_12_avx2 (vvc_alf.c:104)
>     vvc_alf_filter_luma_120x40_12_avx2 (vvc_alf.c:104)
>     vvc_alf_filter_luma_120x44_12_avx2 (vvc_alf.c:104)
>     vvc_alf_filter_luma_120x48_12_avx2 (vvc_alf.c:104)
>     vvc_alf_filter_luma_120x52_12_avx2 (vvc_alf.c:104)
>     vvc_alf_filter_luma_120x56_12_avx2 (vvc_alf.c:104)
>     vvc_alf_filter_luma_120x60_12_avx2 (vvc_alf.c:104)
>     vvc_alf_filter_luma_120x64_12_avx2 (vvc_alf.c:104)
>     vvc_alf_filter_luma_120x68_12_avx2 (vvc_alf.c:104)
>     vvc_alf_filter_luma_120x72_12_avx2 (vvc_alf.c:104)
>     vvc_alf_filter_luma_120x76_12_avx2 (vvc_alf.c:104)
>     vvc_alf_filter_luma_120x80_12_avx2 (vvc_alf.c:104)
>     vvc_alf_filter_luma_120x84_12_avx2 (vvc_alf.c:104)
>     vvc_alf_filter_luma_120x88_12_avx2 (vvc_alf.c:104)
>     vvc_alf_filter_luma_120x92_12_avx2 (vvc_alf.c:104)
>     vvc_alf_filter_luma_120x96_12_avx2 (vvc_alf.c:104)
>     vvc_alf_filter_luma_120x100_12_avx2 (vvc_alf.c:104)
>     vvc_alf_filter_luma_120x104_12_avx2 (vvc_alf.c:104)
>     vvc_alf_filter_luma_120x108_12_avx2 (vvc_alf.c:104)
>     vvc_alf_filter_luma_120x112_12_avx2 (vvc_alf.c:104)
>     vvc_alf_filter_luma_120x116_12_avx2 (vvc_alf.c:104)
>     vvc_alf_filter_luma_120x120_12_avx2 (vvc_alf.c:104)
>     vvc_alf_filter_luma_120x124_12_avx2 (vvc_alf.c:104)
>     vvc_alf_filter_luma_120x128_12_avx2 (vvc_alf.c:104)
>   - vvc_alf.alf_filter   [FAILED]
>   - vvc_alf.alf_classify [OK]
> checkasm: 28 of 9216 tests have failed
> 
> Reported-by: James Almer <jamrial@gmail.com>
> Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
> ---
>  libavcodec/x86/vvc/vvc_alf.asm | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/libavcodec/x86/vvc/vvc_alf.asm b/libavcodec/x86/vvc/vvc_alf.asm
> index 71e821c27b..f7b3e2a6cc 100644
> --- a/libavcodec/x86/vvc/vvc_alf.asm
> +++ b/libavcodec/x86/vvc/vvc_alf.asm
> @@ -356,7 +356,8 @@ SECTION .text
>  
>      FILTER_VB         xq
>  
> -    paddw             m0, m2
> +    ; sum += curr
> +    paddsw             m0, m2
>  
>      ; clip to pixel
>      CLIPW             m0, m14, m15

And can I get an answer to the question of whether the issue is present
when used by the actual decoder and not only the checkasm test?

- Andreas

_______________________________________________
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".

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [FFmpeg-devel] 回复:  [PATCH v2 1/3] avcodec/x86/vvc/vvc_alf: fix integer overflow
  2024-05-30 18:33 ` Andreas Rheinhardt
@ 2024-05-30 19:45   ` Wu Jianhua
  2024-05-30 20:49   ` [FFmpeg-devel] " Ronald S. Bultje
  1 sibling, 0 replies; 7+ messages in thread
From: Wu Jianhua @ 2024-05-30 19:45 UTC (permalink / raw)
  To: ffmpeg-devel, andreas.rheinhardt

Andreas Rheinhardt:
> 发件人: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> 代表 Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> 发送时间: 2024年5月30日 11:33
> 收件人: ffmpeg-devel@ffmpeg.org
> 主题: Re: [FFmpeg-devel] [PATCH v2 1/3] avcodec/x86/vvc/vvc_alf: fix integer overflow
> 
> toqsxw@outlook.com:
> > From: Wu Jianhua <toqsxw@outlook.com>
> >
> > Some tests fails with certain seeds
> >
> > tests/checkasm/checkasm 2325607578 --test=vvc_alf
> > checkasm: using random seed 2325607578
> 

> And can I get an answer to the question of whether the issue is present
> when used by the actual decoder and not only the checkasm test?
> 
> - Andreas
> 

Sure. This issue hasn't occurred in the actual decoding of our tests but only in the checksum test, for the filter is generated randomly.

Thanks,
Jianhua
_______________________________________________
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".

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [FFmpeg-devel] [PATCH v2 1/3] avcodec/x86/vvc/vvc_alf: fix integer overflow
  2024-05-30 18:33 ` Andreas Rheinhardt
  2024-05-30 19:45   ` [FFmpeg-devel] 回复: " Wu Jianhua
@ 2024-05-30 20:49   ` Ronald S. Bultje
  2024-05-31 11:54     ` Nuo Mi
  1 sibling, 1 reply; 7+ messages in thread
From: Ronald S. Bultje @ 2024-05-30 20:49 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

Hi Andreas,

On Thu, May 30, 2024 at 2:33 PM Andreas Rheinhardt <
andreas.rheinhardt@outlook.com> wrote:

> toqsxw@outlook.com:
> > From: Wu Jianhua <toqsxw@outlook.com>
> >
> > Some tests fails with certain seeds
> >
> > tests/checkasm/checkasm 2325607578 --test=vvc_alf
> > checkasm: using random seed 2325607578
> > AVX2:
> >     vvc_alf_filter_luma_120x20_12_avx2 (vvc_alf.c:104)
> >     vvc_alf_filter_luma_120x24_12_avx2 (vvc_alf.c:104)
> >     vvc_alf_filter_luma_120x28_12_avx2 (vvc_alf.c:104)
> >     vvc_alf_filter_luma_120x32_12_avx2 (vvc_alf.c:104)
> >     vvc_alf_filter_luma_120x36_12_avx2 (vvc_alf.c:104)
> >     vvc_alf_filter_luma_120x40_12_avx2 (vvc_alf.c:104)
> >     vvc_alf_filter_luma_120x44_12_avx2 (vvc_alf.c:104)
> >     vvc_alf_filter_luma_120x48_12_avx2 (vvc_alf.c:104)
> >     vvc_alf_filter_luma_120x52_12_avx2 (vvc_alf.c:104)
> >     vvc_alf_filter_luma_120x56_12_avx2 (vvc_alf.c:104)
> >     vvc_alf_filter_luma_120x60_12_avx2 (vvc_alf.c:104)
> >     vvc_alf_filter_luma_120x64_12_avx2 (vvc_alf.c:104)
> >     vvc_alf_filter_luma_120x68_12_avx2 (vvc_alf.c:104)
> >     vvc_alf_filter_luma_120x72_12_avx2 (vvc_alf.c:104)
> >     vvc_alf_filter_luma_120x76_12_avx2 (vvc_alf.c:104)
> >     vvc_alf_filter_luma_120x80_12_avx2 (vvc_alf.c:104)
> >     vvc_alf_filter_luma_120x84_12_avx2 (vvc_alf.c:104)
> >     vvc_alf_filter_luma_120x88_12_avx2 (vvc_alf.c:104)
> >     vvc_alf_filter_luma_120x92_12_avx2 (vvc_alf.c:104)
> >     vvc_alf_filter_luma_120x96_12_avx2 (vvc_alf.c:104)
> >     vvc_alf_filter_luma_120x100_12_avx2 (vvc_alf.c:104)
> >     vvc_alf_filter_luma_120x104_12_avx2 (vvc_alf.c:104)
> >     vvc_alf_filter_luma_120x108_12_avx2 (vvc_alf.c:104)
> >     vvc_alf_filter_luma_120x112_12_avx2 (vvc_alf.c:104)
> >     vvc_alf_filter_luma_120x116_12_avx2 (vvc_alf.c:104)
> >     vvc_alf_filter_luma_120x120_12_avx2 (vvc_alf.c:104)
> >     vvc_alf_filter_luma_120x124_12_avx2 (vvc_alf.c:104)
> >     vvc_alf_filter_luma_120x128_12_avx2 (vvc_alf.c:104)
> >   - vvc_alf.alf_filter   [FAILED]
> >   - vvc_alf.alf_classify [OK]
> > checkasm: 28 of 9216 tests have failed
> >
> > Reported-by: James Almer <jamrial@gmail.com>
> > Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
> > ---
> >  libavcodec/x86/vvc/vvc_alf.asm | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/libavcodec/x86/vvc/vvc_alf.asm
> b/libavcodec/x86/vvc/vvc_alf.asm
> > index 71e821c27b..f7b3e2a6cc 100644
> > --- a/libavcodec/x86/vvc/vvc_alf.asm
> > +++ b/libavcodec/x86/vvc/vvc_alf.asm
> > @@ -356,7 +356,8 @@ SECTION .text
> >
> >      FILTER_VB         xq
> >
> > -    paddw             m0, m2
> > +    ; sum += curr
> > +    paddsw             m0, m2
> >
> >      ; clip to pixel
> >      CLIPW             m0, m14, m15
>
> And can I get an answer to the question of whether the issue is present
> when used by the actual decoder and not only the checkasm test?
>

From my reading of the source code, this could happen in a crafted (e.g.
fuzzed) stream.

Ronald
_______________________________________________
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".

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [FFmpeg-devel] [PATCH v2 1/3] avcodec/x86/vvc/vvc_alf: fix integer overflow
  2024-05-30 20:49   ` [FFmpeg-devel] " Ronald S. Bultje
@ 2024-05-31 11:54     ` Nuo Mi
  0 siblings, 0 replies; 7+ messages in thread
From: Nuo Mi @ 2024-05-31 11:54 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

On Fri, May 31, 2024 at 4:49 AM Ronald S. Bultje <rsbultje@gmail.com> wrote:

> Hi Andreas,
>
> On Thu, May 30, 2024 at 2:33 PM Andreas Rheinhardt <
> andreas.rheinhardt@outlook.com> wrote:
>
> > toqsxw@outlook.com:
> > > From: Wu Jianhua <toqsxw@outlook.com>
> > >
> > > Some tests fails with certain seeds
> > >
> > > tests/checkasm/checkasm 2325607578 --test=vvc_alf
> > > checkasm: using random seed 2325607578
> > > AVX2:
> > >     vvc_alf_filter_luma_120x20_12_avx2 (vvc_alf.c:104)
> > >     vvc_alf_filter_luma_120x24_12_avx2 (vvc_alf.c:104)
> > >     vvc_alf_filter_luma_120x28_12_avx2 (vvc_alf.c:104)
> > >     vvc_alf_filter_luma_120x32_12_avx2 (vvc_alf.c:104)
> > >     vvc_alf_filter_luma_120x36_12_avx2 (vvc_alf.c:104)
> > >     vvc_alf_filter_luma_120x40_12_avx2 (vvc_alf.c:104)
> > >     vvc_alf_filter_luma_120x44_12_avx2 (vvc_alf.c:104)
> > >     vvc_alf_filter_luma_120x48_12_avx2 (vvc_alf.c:104)
> > >     vvc_alf_filter_luma_120x52_12_avx2 (vvc_alf.c:104)
> > >     vvc_alf_filter_luma_120x56_12_avx2 (vvc_alf.c:104)
> > >     vvc_alf_filter_luma_120x60_12_avx2 (vvc_alf.c:104)
> > >     vvc_alf_filter_luma_120x64_12_avx2 (vvc_alf.c:104)
> > >     vvc_alf_filter_luma_120x68_12_avx2 (vvc_alf.c:104)
> > >     vvc_alf_filter_luma_120x72_12_avx2 (vvc_alf.c:104)
> > >     vvc_alf_filter_luma_120x76_12_avx2 (vvc_alf.c:104)
> > >     vvc_alf_filter_luma_120x80_12_avx2 (vvc_alf.c:104)
> > >     vvc_alf_filter_luma_120x84_12_avx2 (vvc_alf.c:104)
> > >     vvc_alf_filter_luma_120x88_12_avx2 (vvc_alf.c:104)
> > >     vvc_alf_filter_luma_120x92_12_avx2 (vvc_alf.c:104)
> > >     vvc_alf_filter_luma_120x96_12_avx2 (vvc_alf.c:104)
> > >     vvc_alf_filter_luma_120x100_12_avx2 (vvc_alf.c:104)
> > >     vvc_alf_filter_luma_120x104_12_avx2 (vvc_alf.c:104)
> > >     vvc_alf_filter_luma_120x108_12_avx2 (vvc_alf.c:104)
> > >     vvc_alf_filter_luma_120x112_12_avx2 (vvc_alf.c:104)
> > >     vvc_alf_filter_luma_120x116_12_avx2 (vvc_alf.c:104)
> > >     vvc_alf_filter_luma_120x120_12_avx2 (vvc_alf.c:104)
> > >     vvc_alf_filter_luma_120x124_12_avx2 (vvc_alf.c:104)
> > >     vvc_alf_filter_luma_120x128_12_avx2 (vvc_alf.c:104)
> > >   - vvc_alf.alf_filter   [FAILED]
> > >   - vvc_alf.alf_classify [OK]
> > > checkasm: 28 of 9216 tests have failed
> > >
> > > Reported-by: James Almer <jamrial@gmail.com>
> > > Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
> > > ---
> > >  libavcodec/x86/vvc/vvc_alf.asm | 3 ++-
> > >  1 file changed, 2 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/libavcodec/x86/vvc/vvc_alf.asm
> > b/libavcodec/x86/vvc/vvc_alf.asm
> > > index 71e821c27b..f7b3e2a6cc 100644
> > > --- a/libavcodec/x86/vvc/vvc_alf.asm
> > > +++ b/libavcodec/x86/vvc/vvc_alf.asm
> > > @@ -356,7 +356,8 @@ SECTION .text
> > >
> > >      FILTER_VB         xq
> > >
> > > -    paddw             m0, m2
> > > +    ; sum += curr
> > > +    paddsw             m0, m2
> > >
> > >      ; clip to pixel
> > >      CLIPW             m0, m14, m15
> >
> > And can I get an answer to the question of whether the issue is present
> > when used by the actual decoder and not only the checkasm test?
> >
>
> From my reading of the source code, this could happen in a crafted (e.g.
> fuzzed) stream.
>
Yes, the test case is valid. So even if the normal clips don't have this
issue, some clips might.

>
> Ronald
> _______________________________________________
> 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".
>
_______________________________________________
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".

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [FFmpeg-devel] [PATCH v2 1/3] avcodec/x86/vvc/vvc_alf: fix integer overflow
  2024-05-30 18:29 ` Ronald S. Bultje
@ 2024-05-31 12:02   ` Nuo Mi
  0 siblings, 0 replies; 7+ messages in thread
From: Nuo Mi @ 2024-05-31 12:02 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

On Fri, May 31, 2024 at 2:29 AM Ronald S. Bultje <rsbultje@gmail.com> wrote:

> Hi,
>
> On Thu, May 30, 2024 at 12:28 PM <toqsxw@outlook.com> wrote:
>
> > From: Wu Jianhua <toqsxw@outlook.com>
> >
> > Some tests fails with certain seeds
> >
> > tests/checkasm/checkasm 2325607578 --test=vvc_alf
> > checkasm: using random seed 2325607578
> > AVX2:
> >     vvc_alf_filter_luma_120x20_12_avx2 (vvc_alf.c:104)
> >     vvc_alf_filter_luma_120x24_12_avx2 (vvc_alf.c:104)
> >     vvc_alf_filter_luma_120x28_12_avx2 (vvc_alf.c:104)
> >     vvc_alf_filter_luma_120x32_12_avx2 (vvc_alf.c:104)
> >     vvc_alf_filter_luma_120x36_12_avx2 (vvc_alf.c:104)
> >     vvc_alf_filter_luma_120x40_12_avx2 (vvc_alf.c:104)
> >     vvc_alf_filter_luma_120x44_12_avx2 (vvc_alf.c:104)
> >     vvc_alf_filter_luma_120x48_12_avx2 (vvc_alf.c:104)
> >     vvc_alf_filter_luma_120x52_12_avx2 (vvc_alf.c:104)
> >     vvc_alf_filter_luma_120x56_12_avx2 (vvc_alf.c:104)
> >     vvc_alf_filter_luma_120x60_12_avx2 (vvc_alf.c:104)
> >     vvc_alf_filter_luma_120x64_12_avx2 (vvc_alf.c:104)
> >     vvc_alf_filter_luma_120x68_12_avx2 (vvc_alf.c:104)
> >     vvc_alf_filter_luma_120x72_12_avx2 (vvc_alf.c:104)
> >     vvc_alf_filter_luma_120x76_12_avx2 (vvc_alf.c:104)
> >     vvc_alf_filter_luma_120x80_12_avx2 (vvc_alf.c:104)
> >     vvc_alf_filter_luma_120x84_12_avx2 (vvc_alf.c:104)
> >     vvc_alf_filter_luma_120x88_12_avx2 (vvc_alf.c:104)
> >     vvc_alf_filter_luma_120x92_12_avx2 (vvc_alf.c:104)
> >     vvc_alf_filter_luma_120x96_12_avx2 (vvc_alf.c:104)
> >     vvc_alf_filter_luma_120x100_12_avx2 (vvc_alf.c:104)
> >     vvc_alf_filter_luma_120x104_12_avx2 (vvc_alf.c:104)
> >     vvc_alf_filter_luma_120x108_12_avx2 (vvc_alf.c:104)
> >     vvc_alf_filter_luma_120x112_12_avx2 (vvc_alf.c:104)
> >     vvc_alf_filter_luma_120x116_12_avx2 (vvc_alf.c:104)
> >     vvc_alf_filter_luma_120x120_12_avx2 (vvc_alf.c:104)
> >     vvc_alf_filter_luma_120x124_12_avx2 (vvc_alf.c:104)
> >     vvc_alf_filter_luma_120x128_12_avx2 (vvc_alf.c:104)
> >   - vvc_alf.alf_filter   [FAILED]
> >   - vvc_alf.alf_classify [OK]
> > checkasm: 28 of 9216 tests have failed
> >
> > Reported-by: James Almer <jamrial@gmail.com>
> > Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
> > ---
> >  libavcodec/x86/vvc/vvc_alf.asm | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/libavcodec/x86/vvc/vvc_alf.asm
> > b/libavcodec/x86/vvc/vvc_alf.asm
> > index 71e821c27b..f7b3e2a6cc 100644
> > --- a/libavcodec/x86/vvc/vvc_alf.asm
> > +++ b/libavcodec/x86/vvc/vvc_alf.asm
> > @@ -356,7 +356,8 @@ SECTION .text
> >
> >      FILTER_VB         xq
> >
> > -    paddw             m0, m2
> > +    ; sum += curr
> > +    paddsw             m0, m2
> >
> >      ; clip to pixel
> >      CLIPW             m0, m14, m15
> > --
> > 2.44.0.windows.1
> >
>
> LGTM.
>
Applied,
Thank you, Jianhua, Andreas, and Ronald.

>
> Ronald
> _______________________________________________
> 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".
>
_______________________________________________
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".

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-05-31 12:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-30 16:28 [FFmpeg-devel] [PATCH v2 1/3] avcodec/x86/vvc/vvc_alf: fix integer overflow toqsxw
2024-05-30 18:29 ` Ronald S. Bultje
2024-05-31 12:02   ` Nuo Mi
2024-05-30 18:33 ` Andreas Rheinhardt
2024-05-30 19:45   ` [FFmpeg-devel] 回复: " Wu Jianhua
2024-05-30 20:49   ` [FFmpeg-devel] " Ronald S. Bultje
2024-05-31 11:54     ` Nuo Mi

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git