glx: fix memory corruption with r5g6b5
should cherry-pick to xserver-1.5
(cherry picked from commit 6c72961d8f
)
This commit is contained in:
parent
38f573566e
commit
336a46c519
@ -420,10 +420,13 @@ findFirstSet(unsigned int v)
|
||||
static void
|
||||
initGlxVisual(VisualPtr visual, __GLXconfig *config)
|
||||
{
|
||||
int maxBits;
|
||||
maxBits = max(config->redBits, max(config->greenBits, config->blueBits));
|
||||
|
||||
config->visualID = visual->vid;
|
||||
visual->class = glxConvertToXVisualType(config->visualType);
|
||||
visual->bitsPerRGBValue = config->redBits;
|
||||
visual->ColormapEntries = 1 << config->redBits;
|
||||
visual->bitsPerRGBValue = maxBits;
|
||||
visual->ColormapEntries = 1 << maxBits;
|
||||
visual->nplanes = config->redBits + config->greenBits + config->blueBits;
|
||||
|
||||
visual->redMask = config->redMask;
|
||||
|
Loading…
Reference in New Issue
Block a user