diff --git a/src/lib/ecore_x/xlib/ecore_x_randr.c b/src/lib/ecore_x/xlib/ecore_x_randr.c index 33c0ffc95d..bdcf8a00e0 100644 --- a/src/lib/ecore_x/xlib/ecore_x_randr.c +++ b/src/lib/ecore_x/xlib/ecore_x_randr.c @@ -1135,6 +1135,18 @@ ecore_x_randr_crtc_outputs_get(Ecore_X_Window root, Ecore_X_Randr_Crtc crtc, int /* try to get crtc info */ if ((info = XRRGetCrtcInfo(_ecore_x_disp, res, crtc))) { + /* if we have no outputs, return NULL */ + if (info->noutput == 0) + { + /* free the crtc info */ + XRRFreeCrtcInfo(info); + + /* free the resources */ + XRRFreeScreenResources(res); + + return NULL; + } + /* try to allocate our return struct */ if ((ret = malloc(info->noutput * sizeof(Ecore_X_Randr_Output)))) {