mirror of
https://gitlab.freedesktop.org/mesa/drm.git
synced 2025-12-20 07:00:11 +01:00
Using sizeof() on a function parameter with an array type does not
work. sizeof() treats such parameters as pointers. Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
This commit is contained in:
parent
a14c3dd0f9
commit
76b4a69aab
1 changed files with 3 additions and 3 deletions
|
|
@ -271,9 +271,9 @@ int drmModeAddFB2(int fd, uint32_t width, uint32_t height,
|
||||||
f.height = height;
|
f.height = height;
|
||||||
f.pixel_format = pixel_format;
|
f.pixel_format = pixel_format;
|
||||||
f.flags = flags;
|
f.flags = flags;
|
||||||
memcpy(f.handles, bo_handles, sizeof(bo_handles));
|
memcpy(f.handles, bo_handles, 4 * sizeof(bo_handles[0]));
|
||||||
memcpy(f.pitches, pitches, sizeof(pitches));
|
memcpy(f.pitches, pitches, 4 * sizeof(pitches[0]));
|
||||||
memcpy(f.offsets, offsets, sizeof(offsets));
|
memcpy(f.offsets, offsets, 4 * sizeof(offsets[0]));
|
||||||
|
|
||||||
if ((ret = DRM_IOCTL(fd, DRM_IOCTL_MODE_ADDFB2, &f)))
|
if ((ret = DRM_IOCTL(fd, DRM_IOCTL_MODE_ADDFB2, &f)))
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue