]> git.sesse.net Git - ffmpeg/commitdiff
checkasm: sw_rgb: Fix mixed declaration and code
authorJun Zhao <barryjzhao@tencent.com>
Sat, 30 May 2020 12:33:53 +0000 (20:33 +0800)
committerJun Zhao <barryjzhao@tencent.com>
Mon, 1 Jun 2020 15:28:07 +0000 (23:28 +0800)
Fix mixed declaration and code.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
tests/checkasm/sw_rgb.c

index 1e8ea151c0d24760a166c55438861cd91990c70c..e5aad20c6dac268fe91872753351456e3095962d 100644 (file)
@@ -137,12 +137,13 @@ static void check_interleave_bytes(void)
             int w = i > 0 ? i : (1 + (rnd() % (MAX_STRIDE-2)));
             int h = 1 + (rnd() % (MAX_HEIGHT-2));
 
-            memset(dst0, 0, 2 * MAX_STRIDE * MAX_HEIGHT);
-            memset(dst1, 0, 2 * MAX_STRIDE * MAX_HEIGHT);
-
             int src0_offset = 0, src0_stride = MAX_STRIDE;
             int src1_offset = 0, src1_stride = MAX_STRIDE;
             int dst_offset  = 0, dst_stride  = 2 * MAX_STRIDE;
+
+            memset(dst0, 0, 2 * MAX_STRIDE * MAX_HEIGHT);
+            memset(dst1, 0, 2 * MAX_STRIDE * MAX_HEIGHT);
+
             // Try different combinations of negative strides
             if (i & 1) {
                 src0_offset = (h-1)*src0_stride;