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] tests/checkasm/sw_rgb: increase plane array buffers
@ 2025-01-28 17:43 James Almer
  2025-01-28 18:20 ` epirat07
  0 siblings, 1 reply; 2+ messages in thread
From: James Almer @ 2025-01-28 17:43 UTC (permalink / raw)
  To: ffmpeg-devel

Fixes stack-buffer-overflow errors running under asan.

Signed-off-by: James Almer <jamrial@gmail.com>
---
 tests/checkasm/sw_rgb.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/tests/checkasm/sw_rgb.c b/tests/checkasm/sw_rgb.c
index 5714bfaa1e..5808cd79e4 100644
--- a/tests/checkasm/sw_rgb.c
+++ b/tests/checkasm/sw_rgb.c
@@ -549,21 +549,21 @@ static void check_yuv2packed1(void)
     const int16_t *chrv[2];
     const int16_t *alpha;
 
-    LOCAL_ALIGNED_8(int32_t, src_y, [INPUT_SIZE]);
-    LOCAL_ALIGNED_8(int32_t, src_u, [INPUT_SIZE]);
-    LOCAL_ALIGNED_8(int32_t, src_v, [INPUT_SIZE]);
-    LOCAL_ALIGNED_8(int32_t, src_a, [INPUT_SIZE]);
+    LOCAL_ALIGNED_8(int32_t, src_y, [2 * INPUT_SIZE]);
+    LOCAL_ALIGNED_8(int32_t, src_u, [2 * INPUT_SIZE]);
+    LOCAL_ALIGNED_8(int32_t, src_v, [2 * INPUT_SIZE]);
+    LOCAL_ALIGNED_8(int32_t, src_a, [2 * INPUT_SIZE]);
 
     LOCAL_ALIGNED_8(uint8_t, dst0, [INPUT_SIZE * sizeof(int32_t[4])]);
     LOCAL_ALIGNED_8(uint8_t, dst1, [INPUT_SIZE * sizeof(int32_t[4])]);
 
-    randomize_buffers((uint8_t*)src_y, INPUT_SIZE * sizeof(int32_t));
-    randomize_buffers((uint8_t*)src_u, INPUT_SIZE * sizeof(int32_t));
-    randomize_buffers((uint8_t*)src_v, INPUT_SIZE * sizeof(int32_t));
-    randomize_buffers((uint8_t*)src_a, INPUT_SIZE * sizeof(int32_t));
+    randomize_buffers((uint8_t*)src_y, 2 * INPUT_SIZE * sizeof(int32_t));
+    randomize_buffers((uint8_t*)src_u, 2 * INPUT_SIZE * sizeof(int32_t));
+    randomize_buffers((uint8_t*)src_v, 2 * INPUT_SIZE * sizeof(int32_t));
+    randomize_buffers((uint8_t*)src_a, 2 * INPUT_SIZE * sizeof(int32_t));
 
     /* Limit to 14 bit input range */
-    for (int i = 0; i < INPUT_SIZE; i++) {
+    for (int i = 0; i < 2 * INPUT_SIZE; i++) {
         src_y[i] &= 0x3FFF3FFF;
         src_a[i] &= 0x3FFF3FFF;
         src_u[i] &= 0x3FFF3FFF;
-- 
2.48.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] 2+ messages in thread

* Re: [FFmpeg-devel] [PATCH] tests/checkasm/sw_rgb: increase plane array buffers
  2025-01-28 17:43 [FFmpeg-devel] [PATCH] tests/checkasm/sw_rgb: increase plane array buffers James Almer
@ 2025-01-28 18:20 ` epirat07
  0 siblings, 0 replies; 2+ messages in thread
From: epirat07 @ 2025-01-28 18:20 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

On 28 Jan 2025, at 18:43, James Almer wrote:

> Fixes stack-buffer-overflow errors running under asan.
>
> Signed-off-by: James Almer <jamrial@gmail.com>
> ---
>  tests/checkasm/sw_rgb.c | 18 +++++++++---------
>  1 file changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/tests/checkasm/sw_rgb.c b/tests/checkasm/sw_rgb.c
> index 5714bfaa1e..5808cd79e4 100644
> --- a/tests/checkasm/sw_rgb.c
> +++ b/tests/checkasm/sw_rgb.c
> @@ -549,21 +549,21 @@ static void check_yuv2packed1(void)
>      const int16_t *chrv[2];
>      const int16_t *alpha;
>
> -    LOCAL_ALIGNED_8(int32_t, src_y, [INPUT_SIZE]);
> -    LOCAL_ALIGNED_8(int32_t, src_u, [INPUT_SIZE]);
> -    LOCAL_ALIGNED_8(int32_t, src_v, [INPUT_SIZE]);
> -    LOCAL_ALIGNED_8(int32_t, src_a, [INPUT_SIZE]);
> +    LOCAL_ALIGNED_8(int32_t, src_y, [2 * INPUT_SIZE]);
> +    LOCAL_ALIGNED_8(int32_t, src_u, [2 * INPUT_SIZE]);
> +    LOCAL_ALIGNED_8(int32_t, src_v, [2 * INPUT_SIZE]);
> +    LOCAL_ALIGNED_8(int32_t, src_a, [2 * INPUT_SIZE]);
>
>      LOCAL_ALIGNED_8(uint8_t, dst0, [INPUT_SIZE * sizeof(int32_t[4])]);
>      LOCAL_ALIGNED_8(uint8_t, dst1, [INPUT_SIZE * sizeof(int32_t[4])]);
>
> -    randomize_buffers((uint8_t*)src_y, INPUT_SIZE * sizeof(int32_t));
> -    randomize_buffers((uint8_t*)src_u, INPUT_SIZE * sizeof(int32_t));
> -    randomize_buffers((uint8_t*)src_v, INPUT_SIZE * sizeof(int32_t));
> -    randomize_buffers((uint8_t*)src_a, INPUT_SIZE * sizeof(int32_t));
> +    randomize_buffers((uint8_t*)src_y, 2 * INPUT_SIZE * sizeof(int32_t));
> +    randomize_buffers((uint8_t*)src_u, 2 * INPUT_SIZE * sizeof(int32_t));
> +    randomize_buffers((uint8_t*)src_v, 2 * INPUT_SIZE * sizeof(int32_t));
> +    randomize_buffers((uint8_t*)src_a, 2 * INPUT_SIZE * sizeof(int32_t));
>
>      /* Limit to 14 bit input range */
> -    for (int i = 0; i < INPUT_SIZE; i++) {
> +    for (int i = 0; i < 2 * INPUT_SIZE; i++) {
>          src_y[i] &= 0x3FFF3FFF;
>          src_a[i] &= 0x3FFF3FFF;
>          src_u[i] &= 0x3FFF3FFF;
> -- 
> 2.48.1

Tested and fixes fate checkasm-sw_rgb with asan for me on macOS (both x86_64 and M1).

>
> _______________________________________________
> 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] 2+ messages in thread

end of thread, other threads:[~2025-01-28 18:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-01-28 17:43 [FFmpeg-devel] [PATCH] tests/checkasm/sw_rgb: increase plane array buffers James Almer
2025-01-28 18:20 ` epirat07

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