mirror of
https://github.com/X11Libre/xserver.git
synced 2026-01-26 05:57:53 +00:00
kdrive/fbdev: Fix uninitialized variable when switching vt's
When rapidly switching vt's, it can happen that shadow tries to draw to the screen before it's initialized. In that case, we return NULL, and we should also return a zero size, because shadow doesn't check for NULL. Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
This commit is contained in:
parent
43232e4f09
commit
76356395e7
@ -318,8 +318,10 @@ fbdevWindowLinear(ScreenPtr pScreen,
|
|||||||
KdScreenPriv(pScreen);
|
KdScreenPriv(pScreen);
|
||||||
FbdevPriv *priv = pScreenPriv->card->driver;
|
FbdevPriv *priv = pScreenPriv->card->driver;
|
||||||
|
|
||||||
if (!pScreenPriv->enabled)
|
if (!pScreenPriv->enabled) {
|
||||||
return 0;
|
*size = 0;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
*size = priv->fix.line_length;
|
*size = priv->fix.line_length;
|
||||||
return (CARD8 *) priv->fb + row * priv->fix.line_length + offset;
|
return (CARD8 *) priv->fb + row * priv->fix.line_length + offset;
|
||||||
}
|
}
|
||||||
@ -332,8 +334,10 @@ fbdevWindowAfb(ScreenPtr pScreen,
|
|||||||
KdScreenPriv(pScreen);
|
KdScreenPriv(pScreen);
|
||||||
FbdevPriv *priv = pScreenPriv->card->driver;
|
FbdevPriv *priv = pScreenPriv->card->driver;
|
||||||
|
|
||||||
if (!pScreenPriv->enabled)
|
if (!pScreenPriv->enabled) {
|
||||||
return 0;
|
*size = 0;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
/* offset to next plane */
|
/* offset to next plane */
|
||||||
*size = priv->var.yres_virtual * priv->fix.line_length;
|
*size = priv->var.yres_virtual * priv->fix.line_length;
|
||||||
return (CARD8 *) priv->fb + row * priv->fix.line_length + offset;
|
return (CARD8 *) priv->fb + row * priv->fix.line_length + offset;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user