forked from enlightenment/efl
Trap for number of crtcs < 1 so we do not try to allocate space for
zero crtcs. Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
parent
d112487e84
commit
f287fd33a7
|
@ -1109,6 +1109,12 @@ ecore_x_randr_window_crtcs_get(Ecore_X_Window window, int *num)
|
|||
XRRScreenResources *res = NULL;
|
||||
Ecore_X_Randr_Crtc *ret = NULL;
|
||||
|
||||
if (ncrtcs <= 0)
|
||||
{
|
||||
free(crtcs);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* make sure we can allocate our return variable */
|
||||
if (!(ret = calloc(1, ncrtcs * sizeof(Ecore_X_Randr_Crtc))))
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue