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-26 12:20:11 -0400 |
commit | 0c5ef339ae36b530745b883347accf11b21b1fd6 (patch) | |
tree | 21ba4bb7cd451c477b3b602baa30d8c12ba7e8c3 /render | |
parent | 025ae119a7561a911533ca69c8232147273af300 (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>
(cherry picked from commit 211d4c2d353b5e379716484055a3f58235ea65f4)
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 fdf034a62..6e23e2bbf 100644 --- a/render/picture.c +++ b/render/picture.c @@ -856,7 +856,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; |