diff mbox series

[FFmpeg-devel,1/2] tests/checkasm/sw_scale.c

Message ID 20210219135539.319974-1-alankelly@google.com
State Accepted
Headers show
Series [FFmpeg-devel,1/2] tests/checkasm/sw_scale.c
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/configure warning Failed to apply patch

Commit Message

Alan Kelly Feb. 19, 2021, 1:55 p.m. UTC
Initialises each item in src and filter arrays to fix valgrind
uninitialised value warning.
---
 casts pointers to uint8_t* and multiplies the buffer size by sizeof(uint16_t).
 tests/checkasm/sw_scale.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

James Almer Feb. 19, 2021, 2:42 p.m. UTC | #1
On 2/19/2021 10:55 AM, Alan Kelly wrote:
> Initialises each item in src and filter arrays to fix valgrind
> uninitialised value warning.
> ---
>   casts pointers to uint8_t* and multiplies the buffer size by sizeof(uint16_t).
>   tests/checkasm/sw_scale.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/checkasm/sw_scale.c b/tests/checkasm/sw_scale.c
> index 7504f8b45f..e3bedd57c6 100644
> --- a/tests/checkasm/sw_scale.c
> +++ b/tests/checkasm/sw_scale.c
> @@ -86,8 +86,8 @@ static void check_yuv2yuvX(void)
>           uint16_t coeff[8];
>       } *vFilterData;
>       uint8_t d_val = rnd();
> -    randomize_buffers(filter_coeff, LARGEST_FILTER);
> -    randomize_buffers(src_pixels, LARGEST_FILTER * LARGEST_INPUT_SIZE);
> +    randomize_buffers((uint8_t*)src_pixels, LARGEST_FILTER * LARGEST_INPUT_SIZE * sizeof(uint16_t));
> +    randomize_buffers((uint8_t*)filter_coeff, LARGEST_FILTER * sizeof(uint16_t));
>       ctx = sws_alloc_context();
>       if (sws_init_context(ctx, NULL, NULL) < 0)
>           fail();

Applied. Thanks.
diff mbox series

Patch

diff --git a/tests/checkasm/sw_scale.c b/tests/checkasm/sw_scale.c
index 7504f8b45f..e3bedd57c6 100644
--- a/tests/checkasm/sw_scale.c
+++ b/tests/checkasm/sw_scale.c
@@ -86,8 +86,8 @@  static void check_yuv2yuvX(void)
         uint16_t coeff[8];
     } *vFilterData;
     uint8_t d_val = rnd();
-    randomize_buffers(filter_coeff, LARGEST_FILTER);
-    randomize_buffers(src_pixels, LARGEST_FILTER * LARGEST_INPUT_SIZE);
+    randomize_buffers((uint8_t*)src_pixels, LARGEST_FILTER * LARGEST_INPUT_SIZE * sizeof(uint16_t));
+    randomize_buffers((uint8_t*)filter_coeff, LARGEST_FILTER * sizeof(uint16_t));
     ctx = sws_alloc_context();
     if (sws_init_context(ctx, NULL, NULL) < 0)
         fail();