This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

commit d5a2ab9c08980b74dce93f55da9d95a7eefef11d
Author:     Michael Niedermayer <[email protected]>
AuthorDate: Mon Jun 15 19:00:00 2026 +0200
Commit:     michaelni <[email protected]>
CommitDate: Wed Jul 1 01:48:33 2026 +0000

    checkasm/sw_rgb: fix too small source stride in uyvytoyuv422 test
    
    The planes table stored a source stride smaller than the 2*width bytes a
    packed UYVY line occupies (e.g. width 12 with stride 12), and the correct
    stride for width 128 would be 256, which does not even fit the uint8_t
    field. The test passed only because the oversized source buffer absorbed
    the resulting out-of-bounds reads.
    
    Derive srcStride from the width (2*width) instead of storing it, so each
    line is passed its true size.
    
    Signed-off-by: Michael Niedermayer <[email protected]>
---
 tests/checkasm/sw_rgb.c | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/tests/checkasm/sw_rgb.c b/tests/checkasm/sw_rgb.c
index a38e1d68f5..7a3049ddd1 100644
--- a/tests/checkasm/sw_rgb.c
+++ b/tests/checkasm/sw_rgb.c
@@ -38,8 +38,8 @@
     } while (0)
 
 static const uint8_t width[] = {12, 16, 20, 32, 36, 128};
-static const struct {uint8_t w, h, s;} planes[] = {
-    {12,16,12}, {16,16,16}, {20,23,25}, {32,18,48}, {8,128,16}, {128,128,128}
+static const struct {uint8_t w, h;} planes[] = {
+    {12,16}, {16,16}, {20,23}, {32,18}, {8,128}, {128,128}
 };
 
 #define MAX_STRIDE 128
@@ -93,6 +93,9 @@ static void check_uyvy_to_422p(void)
 
     if (check_func(uyvytoyuv422, "uyvytoyuv422")) {
         for (i = 0; i < 6; i ++) {
+            int w = planes[i].w, h = planes[i].h;
+            int srcStride = 2 * w;
+
             memset(dst_y_0, 0, MAX_STRIDE * MAX_HEIGHT);
             memset(dst_y_1, 0, MAX_STRIDE * MAX_HEIGHT);
             memset(dst_u_0, 0, (MAX_STRIDE/2) * MAX_HEIGHT);
@@ -100,17 +103,17 @@ static void check_uyvy_to_422p(void)
             memset(dst_v_0, 0, (MAX_STRIDE/2) * MAX_HEIGHT);
             memset(dst_v_1, 0, (MAX_STRIDE/2) * MAX_HEIGHT);
 
-            call_ref(dst_y_0, dst_u_0, dst_v_0, src0, planes[i].w, planes[i].h,
-                     MAX_STRIDE, MAX_STRIDE / 2, planes[i].s);
-            call_new(dst_y_1, dst_u_1, dst_v_1, src1, planes[i].w, planes[i].h,
-                     MAX_STRIDE, MAX_STRIDE / 2, planes[i].s);
+            call_ref(dst_y_0, dst_u_0, dst_v_0, src0, w, h,
+                     MAX_STRIDE, MAX_STRIDE / 2, srcStride);
+            call_new(dst_y_1, dst_u_1, dst_v_1, src1, w, h,
+                     MAX_STRIDE, MAX_STRIDE / 2, srcStride);
             if (memcmp(dst_y_0, dst_y_1, MAX_STRIDE * MAX_HEIGHT) ||
                 memcmp(dst_u_0, dst_u_1, (MAX_STRIDE/2) * MAX_HEIGHT) ||
                 memcmp(dst_v_0, dst_v_1, (MAX_STRIDE/2) * MAX_HEIGHT))
                 fail();
         }
         bench_new(dst_y_1, dst_u_1, dst_v_1, src1, planes[5].w, planes[5].h,
-                  MAX_STRIDE, MAX_STRIDE / 2, planes[5].s);
+                  MAX_STRIDE, MAX_STRIDE / 2, 2 * planes[5].w);
     }
 }
 

_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to