mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-01-06 22:30:14 +01:00
Check pixmap allocation return value when creating glyphs
The driver may decide that the pixmap is too large or something and
fail to allocate a pixmap; not checking would lead to a segfault.
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
(cherry picked from commit 87ea5760f8)
This commit is contained in:
parent
e789c860a6
commit
4b7ff07db2
1 changed files with 7 additions and 0 deletions
|
|
@ -1159,6 +1159,12 @@ ProcRenderAddGlyphs (ClientPtr client)
|
|||
width, height, depth,
|
||||
CREATE_PIXMAP_USAGE_GLYPH_PICTURE);
|
||||
|
||||
if (!pDstPix)
|
||||
{
|
||||
err = BadAlloc;
|
||||
goto bail;
|
||||
}
|
||||
|
||||
GlyphPicture (glyph)[screen] = pDst =
|
||||
CreatePicture (0, &pDstPix->drawable,
|
||||
glyphSet->format,
|
||||
|
|
@ -1168,6 +1174,7 @@ ProcRenderAddGlyphs (ClientPtr client)
|
|||
/* The picture takes a reference to the pixmap, so we
|
||||
drop ours. */
|
||||
(pScreen->DestroyPixmap) (pDstPix);
|
||||
pDstPix = NULL;
|
||||
|
||||
if (! pDst)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue