forked from enlightenment/efl
Guard against trying to allocate 0 outputs.
Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
parent
f287fd33a7
commit
8aef3fa98a
|
@ -1109,7 +1109,7 @@ ecore_x_randr_window_crtcs_get(Ecore_X_Window window, int *num)
|
||||||
XRRScreenResources *res = NULL;
|
XRRScreenResources *res = NULL;
|
||||||
Ecore_X_Randr_Crtc *ret = NULL;
|
Ecore_X_Randr_Crtc *ret = NULL;
|
||||||
|
|
||||||
if (ncrtcs <= 0)
|
if (ncrtcs < 1)
|
||||||
{
|
{
|
||||||
free(crtcs);
|
free(crtcs);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -1695,11 +1695,14 @@ ecore_x_randr_crtc_settings_set(Ecore_X_Window root, Ecore_X_Randr_Crtc crtc, Ec
|
||||||
if (noutputs < 0)
|
if (noutputs < 0)
|
||||||
{
|
{
|
||||||
noutputs = info->noutput;
|
noutputs = info->noutput;
|
||||||
|
if (noutputs > 0)
|
||||||
|
{
|
||||||
routputs = malloc(noutputs * sizeof(RROutput));
|
routputs = malloc(noutputs * sizeof(RROutput));
|
||||||
for (i = 0; i < noutputs; i++)
|
for (i = 0; i < noutputs; i++)
|
||||||
routputs[i] = info->outputs[i];
|
routputs[i] = info->outputs[i];
|
||||||
need_free = EINA_TRUE;
|
need_free = EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else if (noutputs > 0)
|
else if (noutputs > 0)
|
||||||
{
|
{
|
||||||
routputs = malloc(noutputs * sizeof(RROutput));
|
routputs = malloc(noutputs * sizeof(RROutput));
|
||||||
|
|
Loading…
Reference in New Issue