diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-12-14 15:55:22 +0000 |
---|---|---|
committer | Adam Jackson <ajax@redhat.com> | 2015-10-06 13:18:22 -0400 |
commit | 211d4c2d353b5e379716484055a3f58235ea65f4 (patch) | |
tree | 1afcd625a5d96713434fcef02a3e9dd1ebd0be52 /render | |
parent | 8a26a4aff570744347a8bed19f693bf631be464e (diff) |
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 <chris@chris-wilson.co.uk>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Diffstat (limited to 'render')
-rw-r--r-- | render/picture.c | 6 |
1 files changed, 5 insertions, 1 deletions
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; |