diff options
author | Chris Michael <cpmichael@osg.samsung.com> | 2016-04-26 11:00:40 -0400 |
---|---|---|
committer | Chris Michael <cpmichael@osg.samsung.com> | 2016-05-03 08:19:46 -0400 |
commit | 14239cac0e80cafeb26bf6678efcde211ac431cf (patch) | |
tree | a7c81c0dac5a730f71d5fc3b605367b950c431ea | |
parent | 17e3e665c524ee732d999ca7fd35ac8c97aa77dd (diff) | |
download | efl-devs/devilhorns/stable-test.tar.gz |
ecore-drm: Add missing initializer for fb2 commanddevs/devilhorns/stable-test
drm_mode_fb_cmd2 has fields for a modifier to handle tiling,
compression, etc (per plane). Even tho we do not use these, we should
at least initialize them to zero else we end up with uninitialized
bytes in the cmd structure.
==11706== Syscall param ioctl(generic) points to uninitialised byte(s)
==11706== at 0x57E05D9: ioctl (in /usr/lib/libc-2.20.so)
==11706== by 0x4D30FA3: drmIoctl (in /usr/lib/libdrm.so.2.4.0)
==11706== by 0x4CDF66B: _ecore_drm_fb_create2 (ecore_drm_fb.c:63)
@fix
Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
-rw-r--r-- | src/lib/ecore_drm/ecore_drm_fb.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/lib/ecore_drm/ecore_drm_fb.c b/src/lib/ecore_drm/ecore_drm_fb.c index 234b06f17c..b5e64b8a6a 100644 --- a/src/lib/ecore_drm/ecore_drm_fb.c +++ b/src/lib/ecore_drm/ecore_drm_fb.c @@ -16,6 +16,7 @@ _ecore_drm_fb_create2(int fd, Ecore_Drm_Fb *fb) { struct drm_mode_fb_cmd2 cmd; uint32_t hdls[4], pitches[4], offsets[4], fmt; + uint64_t modifiers[4]; #define _fourcc_code(a,b,c,d) \ ((uint32_t)(a) | ((uint32_t)(b) << 8) | \ @@ -25,6 +26,7 @@ _ecore_drm_fb_create2(int fd, Ecore_Drm_Fb *fb) hdls[0] = fb->hdl; pitches[0] = fb->stride; offsets[0] = 0; + modifiers[0] = 0; memset(&cmd, 0, sizeof(struct drm_mode_fb_cmd2)); cmd.fb_id = 0; @@ -35,6 +37,7 @@ _ecore_drm_fb_create2(int fd, Ecore_Drm_Fb *fb) memcpy(cmd.handles, hdls, 4 * sizeof(hdls[0])); memcpy(cmd.pitches, pitches, 4 * sizeof(pitches[0])); memcpy(cmd.offsets, offsets, 4 * sizeof(offsets[0])); + memcpy(cmd.modifier, modifiers, 4 * sizeof(modifiers[0])); if (drmIoctl(fd, DRM_IOCTL_MODE_ADDFB2, &cmd)) return EINA_FALSE; |