diff mbox

modetest: initialize handles/pitches in set_plane()

Message ID 1429555560-6479-1-git-send-email-tjakobi@math.uni-bielefeld.de (mailing list archive)
State New, archived
Headers show

Commit Message

Tobias Jakobi April 20, 2015, 6:46 p.m. UTC
Only the 'offsets' array was initialized to zero.
Since bo_create only sets the handles which are
necessary, were we passing garbage data to the
kernel when calling drmModeAddFB2 later.

The issue only seems to appear when passing e.g.
NV12 data to the kernel, a case where not only
handles[0] is used. I therefore also removed the
corresponding comment.

Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
---
 tests/modetest/modetest.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

diff --git a/tests/modetest/modetest.c b/tests/modetest/modetest.c
index 53dfe05..34d86d0 100644
--- a/tests/modetest/modetest.c
+++ b/tests/modetest/modetest.c
@@ -969,7 +969,7 @@  page_flip_handler(int fd, unsigned int frame,
 static int set_plane(struct device *dev, struct plane_arg *p)
 {
 	drmModePlane *ovr;
-	uint32_t handles[4], pitches[4], offsets[4] = {0}; /* we only use [0] */
+	uint32_t handles[4] = {0}, pitches[4] = {0}, offsets[4] = {0};
 	uint32_t plane_id = 0;
 	struct bo *plane_bo;
 	uint32_t plane_flags = 0;