Xephyr: Check screen resources creation success
If the screen pixmap or the corresponding texture creation with glamor fails, exit cleanly with an error message instead of segfaulting. Fixes: https://bugzilla.redhat.com/1431633 Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
This commit is contained in:
parent
f40ff18c96
commit
b0ce1d088a
|
@ -725,8 +725,10 @@ ephyrCreateResources(ScreenPtr pScreen)
|
||||||
ephyrShadowUpdate, ephyrWindowLinear);
|
ephyrShadowUpdate, ephyrWindowLinear);
|
||||||
else {
|
else {
|
||||||
#ifdef GLAMOR
|
#ifdef GLAMOR
|
||||||
if (ephyr_glamor)
|
if (ephyr_glamor) {
|
||||||
ephyr_glamor_create_screen_resources(pScreen);
|
if (!ephyr_glamor_create_screen_resources(pScreen))
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
return ephyrSetInternalDamage(pScreen);
|
return ephyrSetInternalDamage(pScreen);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1559,6 +1559,8 @@ ephyr_glamor_create_screen_resources(ScreenPtr pScreen)
|
||||||
pScreen->height,
|
pScreen->height,
|
||||||
pScreen->rootDepth,
|
pScreen->rootDepth,
|
||||||
GLAMOR_CREATE_NO_LARGE);
|
GLAMOR_CREATE_NO_LARGE);
|
||||||
|
if (!screen_pixmap)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
pScreen->SetScreenPixmap(screen_pixmap);
|
pScreen->SetScreenPixmap(screen_pixmap);
|
||||||
if (pScreen->root && pScreen->SetWindowPixmap)
|
if (pScreen->root && pScreen->SetWindowPixmap)
|
||||||
|
@ -1566,6 +1568,9 @@ ephyr_glamor_create_screen_resources(ScreenPtr pScreen)
|
||||||
|
|
||||||
/* Tell the GLX code what to GL texture to read from. */
|
/* Tell the GLX code what to GL texture to read from. */
|
||||||
tex = glamor_get_pixmap_texture(screen_pixmap);
|
tex = glamor_get_pixmap_texture(screen_pixmap);
|
||||||
|
if (!tex)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
ephyr_glamor_set_texture(scrpriv->glamor, tex);
|
ephyr_glamor_set_texture(scrpriv->glamor, tex);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user