summaryrefslogtreecommitdiff
path: root/src/sna
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-05-27 20:14:02 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2014-05-27 20:19:49 +0100
commitd8360bd74f5b62a27c019c65ed9001cac8bf43ed (patch)
tree28c6d4179789d0d73412bbe6c0d437503f3f5604 /src/sna
parent93b319cf9a355e8400b864046cdb4cfb56b657a0 (diff)
sna: Handle bad picture format/depth mismatches
Scaling the output feed in an invalid picture->format/depth combination which causes the fallback downsampling function to explode. Whilst this is a bug in the higher layer, we can handle the error anyway. References: https://bugs.freedesktop.org/show_bug.cgi?id=79320 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna')
-rw-r--r--src/sna/sna_render.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/sna/sna_render.c b/src/sna/sna_render.c
index d3cb6a0f..fd73b090 100644
--- a/src/sna/sna_render.c
+++ b/src/sna/sna_render.c
@@ -789,6 +789,11 @@ fixup:
format = PictureMatchFormat(screen,
pixmap->drawable.depth,
picture->format);
+ if (format == NULL) {
+ DBG(("%s: invalid depth=%d, format=%08x\n",
+ __FUNCTION__, pixmap->drawable.depth, picture->format));
+ goto fixup;
+ }
tmp_dst = CreatePicture(0, &tmp->drawable, format, 0, NULL,
serverClient, &error);