All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] lib/igt_fb: fix the plane_size array for yuv formats
@ 2021-11-29 21:00 Abhinav Kumar
  2021-11-29 22:44 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Abhinav Kumar @ 2021-11-29 21:00 UTC (permalink / raw)
  To: igt-dev; +Cc: petri.latvala, quic_khsieh, swboyd, nganji, seanpaul, aravindh

clear_yuv_buffer() checks the size of the plane_size[] to
make sure its greater than the number of planes to avoid
overflows.

The plane_size[] is fixed to two currently.

However some of the formats like YV12 indeed have more than
2 planes in the format_desc[] hence this incorrectly failing
this check.

Increase the size of the plane_size[] to match the correct
max number of planes.

Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
---
 lib/igt_fb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index 92a0170..e42302d 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -1007,7 +1007,7 @@ static void memset64(uint64_t *s, uint64_t c, size_t n)
 static void clear_yuv_buffer(struct igt_fb *fb)
 {
 	bool full_range = fb->color_range == IGT_COLOR_YCBCR_FULL_RANGE;
-	size_t plane_size[2];
+	size_t plane_size[3];
 	void *ptr;
 
 	igt_assert(igt_format_is_yuv(fb->drm_format));
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-12-01 15:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-29 21:00 [igt-dev] [PATCH i-g-t] lib/igt_fb: fix the plane_size array for yuv formats Abhinav Kumar
2021-11-29 22:44 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2021-11-30  1:01 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2021-12-01 15:35 ` [igt-dev] [PATCH i-g-t] " Mark Yacoub

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.