summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Michael <cpmichael@osg.samsung.com>2016-05-11 09:43:53 -0400
committerChris Michael <cpmichael@osg.samsung.com>2016-05-27 11:57:53 -0400
commit6697584fb9d553c2cd317ab3adffba04b5f710a3 (patch)
tree627ff68e37ed6e35311fa6a40fc0edbae93c97db
parente934f546ad10e6aed599d7f4968e8c19871bfcd2 (diff)
downloadefl-6697584fb9d553c2cd317ab3adffba04b5f710a3.tar.gz
ecore-drm2: Fix potential invalid access to output current_mode
Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
-rw-r--r--src/lib/ecore_drm2/ecore_drm2_outputs.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/lib/ecore_drm2/ecore_drm2_outputs.c b/src/lib/ecore_drm2/ecore_drm2_outputs.c
index 81e0018047..7596164f73 100644
--- a/src/lib/ecore_drm2/ecore_drm2_outputs.c
+++ b/src/lib/ecore_drm2/ecore_drm2_outputs.c
@@ -90,11 +90,21 @@ _output_event_send(Ecore_Drm2_Output *output)
ev->x = output->x;
ev->y = output->y;
- ev->w = output->current_mode->width;
- ev->h = output->current_mode->height;
+ if (output->current_mode)
+ {
+ ev->w = output->current_mode->width;
+ ev->h = output->current_mode->height;
+ ev->refresh = output->current_mode->refresh;
+ }
+ else
+ {
+ ev->w = output->ocrtc->width;
+ ev->h = output->ocrtc->height;
+ ev->refresh = 0;
+ }
+
ev->phys_width = output->pw;
ev->phys_height = output->ph;
- ev->refresh = output->current_mode->refresh;
ev->scale = output->scale;
ev->subpixel = output->subpixel;