From 211d4c2d353b5e379716484055a3f58235ea65f4 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Wed, 14 Dec 2011 15:55:22 +0000 Subject: render: Propagate allocation failure from createSourcePicture() All the callers were already checking for failure, except that createSourcePicture() itself was failing to check whether it successfully allocated the Picture. [ajax: Rebase, fix line wrap of preceding line] Signed-off-by: Chris Wilson Reviewed-by: Jeremy Huddleston --- render/picture.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/render/picture.c b/render/picture.c index 3d52dec01..6d9c9df3a 100644 --- a/render/picture.c +++ b/render/picture.c @@ -862,7 +862,11 @@ createSourcePicture(void) { PicturePtr pPicture; - pPicture = dixAllocateScreenObjectWithPrivates(NULL, PictureRec, PRIVATE_PICTURE); + pPicture = dixAllocateScreenObjectWithPrivates(NULL, PictureRec, + PRIVATE_PICTURE); + if (!pPicture) + return 0; + pPicture->pDrawable = 0; pPicture->pFormat = 0; pPicture->pNext = 0; -- cgit v1.2.3