summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2014-10-21 08:18:34 -0400
committerChris Michael <cp.michael@samsung.com>2014-10-21 08:18:34 -0400
commit6cf9246ad63b77f0dcc3bec92862529debf48fed (patch)
tree531b12aeb730982b72eadfbd79fd82e2f8290d0b
parent01a487d881b7153753f2cc5d1fd85a3580b38fbf (diff)
downloadefl-6cf9246ad63b77f0dcc3bec92862529debf48fed.tar.gz
ecore-drm: Default output to NULL and add safety check for NULL output
after the device loop. Summary: If there are no outputs created during the loop, we would end up crashing here by checking output->watch. This fixes that situation without leaking resources because we still end up doing our cleanup. NB: Thanks Cedric for the report !! :) @fix Signed-off-by: Chris Michael <cp.michael@samsung.com>
-rw-r--r--src/lib/ecore_drm/ecore_drm_output.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/ecore_drm/ecore_drm_output.c b/src/lib/ecore_drm/ecore_drm_output.c
index 69babf53e4..396e888aaf 100644
--- a/src/lib/ecore_drm/ecore_drm_output.c
+++ b/src/lib/ecore_drm/ecore_drm_output.c
@@ -647,7 +647,7 @@ EAPI Eina_Bool
ecore_drm_outputs_create(Ecore_Drm_Device *dev)
{
Eina_Bool ret = EINA_TRUE;
- Ecore_Drm_Output *output;
+ Ecore_Drm_Output *output = NULL;
drmModeConnector *conn;
drmModeRes *res;
drmModeCrtc *crtc;
@@ -737,7 +737,7 @@ ecore_drm_outputs_create(Ecore_Drm_Device *dev)
/* free resources */
drmModeFreeResources(res);
- if (!output->watch)
+ if ((output) && (!output->watch))
{
int events = 0;