mirror of https://github.com/xbmc/xbmc
xbmc-xrandc: Fix malloc(0) behavior
This commit is contained in:
parent
88193f72d0
commit
36cb2c569f
|
|
@ -596,9 +596,13 @@ static void set_transform(
|
|||
dest->transform = *transform;
|
||||
dest->filter = strdup(filter);
|
||||
dest->nparams = nparams;
|
||||
dest->params = malloc(nparams * sizeof(XFixed));
|
||||
if (nparams)
|
||||
{
|
||||
dest->params = malloc(nparams * sizeof(XFixed));
|
||||
memcpy(dest->params, params, nparams * sizeof(XFixed));
|
||||
}
|
||||
else
|
||||
dest->params = NULL;
|
||||
}
|
||||
|
||||
static void copy_transform(transform_t* dest, transform_t* src)
|
||||
|
|
|
|||
Loading…
Reference in New Issue