[PATCH] libdrm: fix sizes of memcpy to the drmModeAddFB2()

Joonyoung Shim jy0922.shim at samsung.com
Tue Dec 13 23:15:02 PST 2011


The variables(bo_handles, pitches and offsets) are the array having 4
elementary of uint32_t type. The their memcpy size is sizeof(uint32_t) *
4.

Signed-off-by: Joonyoung Shim <jy0922.shim at samsung.com>
---
 xf86drmMode.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/xf86drmMode.c b/xf86drmMode.c
index ffa6dc4..8065f20 100644
--- a/xf86drmMode.c
+++ b/xf86drmMode.c
@@ -267,9 +267,9 @@ int drmModeAddFB2(int fd, uint32_t width, uint32_t height,
 	f.height = height;
 	f.pixel_format = pixel_format;
 	f.flags = flags;
-	memcpy(f.handles, bo_handles, sizeof(bo_handles));
-	memcpy(f.pitches, pitches, sizeof(pitches));
-	memcpy(f.offsets, offsets, sizeof(offsets));
+	memcpy(f.handles, bo_handles, sizeof(uint32_t) * 4);
+	memcpy(f.pitches, pitches, sizeof(uint32_t) * 4);
+	memcpy(f.offsets, offsets, sizeof(uint32_t) * 4);
 
 	if ((ret = DRM_IOCTL(fd, DRM_IOCTL_MODE_ADDFB2, &f)))
 		return ret;
-- 
1.7.5.4



More information about the dri-devel mailing list