[Bug 109257] New: [igt] new compilation error with GCC 9

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Wed Jan 9 10:46:49 UTC 2019


https://bugs.freedesktop.org/show_bug.cgi?id=109257

            Bug ID: 109257
           Summary: [igt] new compilation error with GCC 9
           Product: DRI
           Version: XOrg git
          Hardware: Other
                OS: All
            Status: NEW
          Severity: normal
          Priority: medium
         Component: DRM/Intel
          Assignee: intel-gfx-bugs at lists.freedesktop.org
          Reporter: mliska at suse.cz
        QA Contact: intel-gfx-bugs at lists.freedesktop.org
                CC: intel-gfx-bugs at lists.freedesktop.org

I see following error:

igt_fb.c:1382:12: error: array subscript 2 is outside array bounds of 'struct
igt_vec4[2]' [-Werror=array-bounds]
 1382 |  rgb->d[0] = rgb24[2];
      |  ~~~~~~~~~~^~~~~~~~~~
igt_fb.c:1549:20: note: while referencing 'rgb'
 1549 |    struct igt_vec4 rgb[2];
      |                    ^~~
igt_fb.c:1383:12: error: array subscript 2 is outside array bounds of 'struct
igt_vec4[2]' [-Werror=array-bounds]
 1383 |  rgb->d[1] = rgb24[1];
      |  ~~~~~~~~~~^~~~~~~~~~
igt_fb.c:1549:20: note: while referencing 'rgb'
 1549 |    struct igt_vec4 rgb[2];
      |                    ^~~
igt_fb.c:1384:12: error: array subscript 2 is outside array bounds of 'struct
igt_vec4[2]' [-Werror=array-bounds]
 1384 |  rgb->d[2] = rgb24[0];
      |  ~~~~~~~~~~^~~~~~~~~~
igt_fb.c:1549:20: note: while referencing 'rgb'
 1549 |    struct igt_vec4 rgb[2];
      |                    ^~~
igt_fb.c:1385:12: error: array subscript 2 is outside array bounds of 'struct
igt_vec4[2]' [-Werror=array-bounds]
 1385 |  rgb->d[3] = 1.0f;
      |  ~~~~~~~~~~^~~~~~
igt_fb.c:1549:20: note: while referencing 'rgb'
 1549 |    struct igt_vec4 rgb[2];
      |                    ^~~

I guess it's a typo and should be fixed by:

diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index 8244e517..5cd1829a 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -1779,7 +1779,7 @@ static void convert_rgb24_to_nv12(struct fb_convert *cvt)
                        struct igt_vec4 yuv[2];

                        read_rgb(&rgb[0], &rgb24[j * 8 + 0]);
-                       read_rgb(&rgb[2], &rgb24[j * 8 + 0 + rgb24_stride]);
+                       read_rgb(&rgb[1], &rgb24[j * 8 + 0 + rgb24_stride]);

                        yuv[0] = igt_matrix_transform(&m, &rgb[0]);
                        yuv[1] = igt_matrix_transform(&m, &rgb[1]);

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/intel-gfx-bugs/attachments/20190109/266c6ae5/attachment.html>


More information about the intel-gfx-bugs mailing list