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

Alan Kelly alankelly at google.com
Fri Feb 19 12:00:57 EET 2021


Initialises each item in src and filter arrays to fix valgrind
uninitialised value warning.
---
 tests/checkasm/sw_scale.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tests/checkasm/sw_scale.c b/tests/checkasm/sw_scale.c
index 7504f8b45f..a4866723d7 100644
--- a/tests/checkasm/sw_scale.c
+++ b/tests/checkasm/sw_scale.c
@@ -86,8 +86,10 @@ 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);
+    for(i = 0; i < LARGEST_FILTER * LARGEST_INPUT_SIZE; ++i)
+      src_pixels[i] = rnd();
+    for(i = 0; i < LARGEST_FILTER; ++i)
+      filter_coeff[i] = rnd();
     ctx = sws_alloc_context();
     if (sws_init_context(ctx, NULL, NULL) < 0)
         fail();
-- 
2.30.0.617.g56c4b15f3c-goog



More information about the ffmpeg-devel mailing list