summaryrefslogtreecommitdiff
path: root/src/lib/ecore_drm2/ecore_drm2_plane.c
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2017-05-05 10:52:05 -0500
committerDerek Foreman <derekf@osg.samsung.com>2017-05-05 12:53:25 -0500
commit18af247ab28f3d4bf199c57f7c9b314df6dde501 (patch)
treeb4ed206a4c58ad892524a7fc250e97065765b935 /src/lib/ecore_drm2/ecore_drm2_plane.c
parentc722466a602794002b374ef0f84de0a92d9cd531 (diff)
ecore_drm2: Add checks for using a plane after death
We keep planes on the plane list to ensure a released plane is removed from display - however this means that if a caller starts messing with a plane after release, that it could potentially reposition a plane it doesn't own anymore. Use EINA_SAFETY macros to prevent this.
Diffstat (limited to 'src/lib/ecore_drm2/ecore_drm2_plane.c')
-rw-r--r--src/lib/ecore_drm2/ecore_drm2_plane.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/lib/ecore_drm2/ecore_drm2_plane.c b/src/lib/ecore_drm2/ecore_drm2_plane.c
index 52f6bfd1d8..e90a740073 100644
--- a/src/lib/ecore_drm2/ecore_drm2_plane.c
+++ b/src/lib/ecore_drm2/ecore_drm2_plane.c
@@ -129,6 +129,7 @@ EAPI void
129ecore_drm2_plane_release(Ecore_Drm2_Plane *plane) 129ecore_drm2_plane_release(Ecore_Drm2_Plane *plane)
130{ 130{
131 EINA_SAFETY_ON_NULL_RETURN(plane); 131 EINA_SAFETY_ON_NULL_RETURN(plane);
132 EINA_SAFETY_ON_TRUE_RETURN(plane->dead);
132 133
133 plane->dead = EINA_TRUE; 134 plane->dead = EINA_TRUE;
134 plane->state->in_use = EINA_FALSE; 135 plane->state->in_use = EINA_FALSE;
@@ -139,6 +140,7 @@ EAPI void
139ecore_drm2_plane_destination_set(Ecore_Drm2_Plane *plane, int x, int y, int w, int h) 140ecore_drm2_plane_destination_set(Ecore_Drm2_Plane *plane, int x, int y, int w, int h)
140{ 141{
141 EINA_SAFETY_ON_NULL_RETURN(plane); 142 EINA_SAFETY_ON_NULL_RETURN(plane);
143 EINA_SAFETY_ON_TRUE_RETURN(plane->dead);
142 144
143 plane->state->cx.value = x; 145 plane->state->cx.value = x;
144 plane->state->cy.value = y; 146 plane->state->cy.value = y;
@@ -155,6 +157,7 @@ ecore_drm2_plane_fb_set(Ecore_Drm2_Plane *plane, Ecore_Drm2_Fb *fb)
155 157
156 EINA_SAFETY_ON_NULL_RETURN_VAL(plane, EINA_FALSE); 158 EINA_SAFETY_ON_NULL_RETURN_VAL(plane, EINA_FALSE);
157 EINA_SAFETY_ON_NULL_RETURN_VAL(fb, EINA_FALSE); 159 EINA_SAFETY_ON_NULL_RETURN_VAL(fb, EINA_FALSE);
160 EINA_SAFETY_ON_TRUE_RETURN_VAL(plane->dead, EINA_FALSE);
158 161
159 fallback_id = plane->state->fid.value; 162 fallback_id = plane->state->fid.value;
160 plane->state->fid.value = fb->id; 163 plane->state->fid.value = fb->id;