sna: Handle malloc failures when downsampling

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2012-01-24 18:33:14 +00:00
parent 4aef9e6f50
commit 22bab3cd7d
1 changed files with 10 additions and 0 deletions

View File

@ -734,9 +734,19 @@ static int sna_render_picture_downsample(struct sna *sna,
tmp_dst = CreatePicture(0, &tmp->drawable, format, 0, NULL,
serverClient, &error);
if (!tmp_dst) {
screen->DestroyPixmap(tmp);
goto fixup;
}
tmp_src = CreatePicture(0, &pixmap->drawable, format, 0, NULL,
serverClient, &error);
if (!tmp_src) {
FreePicture(tmp_dst, 0);
screen->DestroyPixmap(tmp);
goto fixup;
}
tmp_src->repeat = true;
tmp_src->repeatType = RepeatPad;
tmp_src->filter = PictFilterBilinear;