From d8360bd74f5b62a27c019c65ed9001cac8bf43ed Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 27 May 2014 20:14:02 +0100 Subject: 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 --- src/sna/sna_render.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/sna') 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); -- cgit v1.2.3