diff options
author | Brian Starkey <brian.starkey@arm.com> | 2017-02-20 11:02:46 +0000 |
---|---|---|
committer | Robert Foss <robert.foss@collabora.com> | 2017-02-21 10:02:21 -0500 |
commit | 45f9bb49b153c0833c088e4fffe7273129fe8715 (patch) | |
tree | e8989b5e90adb6d12f0ce4ed20cfbff8dad2a692 /lib/igt_kms.c | |
parent | 1ab629f0f9da4773b5590b91694a5592d21344d5 (diff) |
lib/igt_kms: Fix possible out-of-bounds access
If there's no primary plane, pipe->plane_primary == -1, and the assert
meant to check that it's valid will access pipe->planes[-1].
Fix that to check that pipe->plane_primary has been set instead.
Fixes: 36656239ef96 lib/igt_kms: Implement dynamic plane count support
Signed-off-by: Brian Starkey <brian.starkey@arm.com>
Reviewed-by: Robert Foss <robert.foss@collabora.com>
Diffstat (limited to 'lib/igt_kms.c')
-rw-r--r-- | lib/igt_kms.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/igt_kms.c b/lib/igt_kms.c index 585aad7a..2073a6ac 100644 --- a/lib/igt_kms.c +++ b/lib/igt_kms.c @@ -1675,9 +1675,9 @@ void igt_display_init(igt_display_t *display, int drm_fd) /* * At the bare minimum, we should expect to have a primary - * plane + * plane, and it must be in slot 0. */ - igt_assert(pipe->planes[pipe->plane_primary].drm_plane); + igt_assert_eq(pipe->plane_primary, 0); if (display->has_cursor_plane) { /* |