]> git.sesse.net Git - ffmpeg/commitdiff
checkasm/sw_scale: properly initialize src_pixer and filter_coeff buffers
authorAlan Kelly <alankelly-at-google.com@ffmpeg.org>
Fri, 19 Feb 2021 13:55:39 +0000 (14:55 +0100)
committerJames Almer <jamrial@gmail.com>
Fri, 19 Feb 2021 14:20:32 +0000 (11:20 -0300)
Fixes valgrind uninitialised value warnings.

Signed-off-by: James Almer <jamrial@gmail.com>
tests/checkasm/sw_scale.c

index 7504f8b45fe4f52a3336c18e798714295ae27579..dee1af820ca0611409442e0f55f2d73b1ddb4372 100644 (file)
@@ -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(int16_t));
+    randomize_buffers((uint8_t*)filter_coeff, LARGEST_FILTER * sizeof(int16_t));
     ctx = sws_alloc_context();
     if (sws_init_context(ctx, NULL, NULL) < 0)
         fail();