summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2019-11-14 12:21:40 -0500
committerChris Michael <cp.michael@samsung.com>2019-11-14 12:21:40 -0500
commit2288c92bc5422c1a5df5fa4f6aabc2307a297e9d (patch)
treee9daed1127a606f9bf7e6a33982197e109097b22
parent9ca573f40f1065cc717c0c5aabb787671bab852b (diff)
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
-rw-r--r--src/lib/ecore_drm2/ecore_drm2_device.c2
-rw-r--r--src/lib/ecore_drm2/ecore_drm2_outputs.c4
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)
487 { 487 {
488 pstate->supported_rotations |= r; 488 pstate->supported_rotations |= r;
489 pstate->rotation_map[ffs(r)] = 489 pstate->rotation_map[ffs(r)] =
490 1 << prop->enums[k].value; 490 1ULL << prop->enums[k].value;
491 } 491 }
492 } 492 }
493 } 493 }
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
659 states = 659 states =
660 eina_list_append(states, _atomic_state_plane_duplicate(pstate)); 660 eina_list_append(states, _atomic_state_plane_duplicate(pstate));
661 } 661 }
662 else if (pstate->mask & (1 << index)) 662 else if (pstate->mask & (1ULL << index))
663 { 663 {
664 states = 664 states =
665 eina_list_append(states, _atomic_state_plane_duplicate(pstate)); 665 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
1454 { 1454 {
1455 if (res->crtcs[k] != output->crtc_id) continue; 1455 if (res->crtcs[k] != output->crtc_id) continue;
1456 1456
1457 if (p & (1 << k)) 1457 if (p & (1ULL << k))
1458 { 1458 {
1459 ret = EINA_TRUE; 1459 ret = EINA_TRUE;
1460 break; 1460 break;