Xvfb: Remove usage of alloca
Replace with heap allocations
This commit is contained in:
parent
259f4c36d5
commit
def6f74f2d
|
@ -482,9 +482,9 @@ vfbInstallColormap(ColormapPtr pmap)
|
||||||
swapcopy32(pXWDHeader->bits_per_rgb, pVisual->bitsPerRGBValue);
|
swapcopy32(pXWDHeader->bits_per_rgb, pVisual->bitsPerRGBValue);
|
||||||
swapcopy32(pXWDHeader->colormap_entries, pVisual->ColormapEntries);
|
swapcopy32(pXWDHeader->colormap_entries, pVisual->ColormapEntries);
|
||||||
|
|
||||||
ppix = (Pixel *)ALLOCATE_LOCAL(entries * sizeof(Pixel));
|
ppix = (Pixel *)xalloc(entries * sizeof(Pixel));
|
||||||
prgb = (xrgb *)ALLOCATE_LOCAL(entries * sizeof(xrgb));
|
prgb = (xrgb *)xalloc(entries * sizeof(xrgb));
|
||||||
defs = (xColorItem *)ALLOCATE_LOCAL(entries * sizeof(xColorItem));
|
defs = (xColorItem *)xalloc(entries * sizeof(xColorItem));
|
||||||
|
|
||||||
for (i = 0; i < entries; i++) ppix[i] = i;
|
for (i = 0; i < entries; i++) ppix[i] = i;
|
||||||
/* XXX truecolor */
|
/* XXX truecolor */
|
||||||
|
@ -499,9 +499,9 @@ vfbInstallColormap(ColormapPtr pmap)
|
||||||
}
|
}
|
||||||
(*pmap->pScreen->StoreColors)(pmap, entries, defs);
|
(*pmap->pScreen->StoreColors)(pmap, entries, defs);
|
||||||
|
|
||||||
DEALLOCATE_LOCAL(ppix);
|
xfree(ppix);
|
||||||
DEALLOCATE_LOCAL(prgb);
|
xfree(prgb);
|
||||||
DEALLOCATE_LOCAL(defs);
|
xfree(defs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user