Commit 9a597280 authored by Eric Anholt's avatar Eric Anholt

glamor: Fix segfault in fallback picture uploading.

If the source/mask pixmap is a pixmap that doesn't have an FBO
attached, and it doesn't match the Render operation's size, then we'll
composite it to a CPU temporary (not sure why).  We would take the
PictFormatShort from the source Picture, make a pixmap of that depth,
and try to look up the PictFormat description from the depth and the
PictFormatShort.  However, the screen's PictFormats are only attached
to the screen's visuals' depths.  So, with an x2r10g10b10 short format
(depth 30), we wouldn't find the screen's PictFormat for it
(associated with depth 32).

Instead of trying to look up from the screen, just use the pFormat
that came from our source picture.  The only time we need to look up a
PictFormat when we're doing non-shader gradients, which we put in
Signed-off-by: Eric Anholt's avatarEric Anholt <>
Reviewed-by: Michel Dänzer's avatarMichel Dänzer <>
parent e7aa4d3c
......@@ -1279,12 +1279,17 @@ glamor_convert_gradient_picture(ScreenPtr screen,
PixmapPtr pixmap;
PicturePtr dst = NULL;
int error;
PictFormatPtr pFormat;
PictFormatShort format;
if (!source->pDrawable)
if (source->pDrawable) {
pFormat = source->pFormat;
format = pFormat->format;
} else {
format = PICT_a8r8g8b8;
format = source->format;
pFormat = PictureMatchFormat(screen, 32, format);
if (!source->pDrawable) {
if (source->pSourcePict->type == SourcePictTypeLinear) {
......@@ -1320,10 +1325,7 @@ glamor_convert_gradient_picture(ScreenPtr screen,
return NULL;
dst = CreatePicture(0,
format), 0, 0, serverClient, &error);
&pixmap->drawable, pFormat, 0, 0, serverClient, &error);
if (!dst)
return NULL;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment