From 2288c92bc5422c1a5df5fa4f6aabc2307a297e9d Mon Sep 17 00:00:00 2001 From: Chris Michael Date: Thu, 14 Nov 2019 12:21:40 -0500 Subject: [PATCH] ecore-drm2: Fix issue of shifting 1 by more than 32bits Based on 9ca573f40f1065cc717c0c5aabb787671bab852b, this patch fixes potential undefined behaviour on 64 bit systems. @fix --- src/lib/ecore_drm2/ecore_drm2_device.c | 2 +- src/lib/ecore_drm2/ecore_drm2_outputs.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/ecore_drm2/ecore_drm2_device.c b/src/lib/ecore_drm2/ecore_drm2_device.c index c86df1a271..7602114453 100644 --- a/src/lib/ecore_drm2/ecore_drm2_device.c +++ b/src/lib/ecore_drm2/ecore_drm2_device.c @@ -487,7 +487,7 @@ _drm2_atomic_state_plane_fill(Ecore_Drm2_Plane_State *pstate, int fd) { pstate->supported_rotations |= r; pstate->rotation_map[ffs(r)] = - 1 << prop->enums[k].value; + 1ULL << prop->enums[k].value; } } } diff --git a/src/lib/ecore_drm2/ecore_drm2_outputs.c b/src/lib/ecore_drm2/ecore_drm2_outputs.c index dfb2fa93d1..6fe3eb5770 100644 --- a/src/lib/ecore_drm2/ecore_drm2_outputs.c +++ b/src/lib/ecore_drm2/ecore_drm2_outputs.c @@ -659,7 +659,7 @@ _output_plane_states_get(Ecore_Drm2_Atomic_State *state, unsigned int crtc_id, i states = eina_list_append(states, _atomic_state_plane_duplicate(pstate)); } - else if (pstate->mask & (1 << index)) + else if (pstate->mask & (1ULL << index)) { states = eina_list_append(states, _atomic_state_plane_duplicate(pstate)); @@ -1454,7 +1454,7 @@ ecore_drm2_output_possible_crtc_get(Ecore_Drm2_Output *output, unsigned int crtc { if (res->crtcs[k] != output->crtc_id) continue; - if (p & (1 << k)) + if (p & (1ULL << k)) { ret = EINA_TRUE; break;