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,10 +1695,13 @@ 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;
|
||||||
routputs = malloc(noutputs * sizeof(RROutput));
|
if (noutputs > 0)
|
||||||
for (i = 0; i < noutputs; i++)
|
{
|
||||||
routputs[i] = info->outputs[i];
|
routputs = malloc(noutputs * sizeof(RROutput));
|
||||||
need_free = EINA_TRUE;
|
for (i = 0; i < noutputs; i++)
|
||||||
|
routputs[i] = info->outputs[i];
|
||||||
|
need_free = EINA_TRUE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (noutputs > 0)
|
else if (noutputs > 0)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue