Commit 78eff73e authored by Ulrich Sibiller's avatar Ulrich Sibiller Committed by Mike Gabriel

render: Propagate allocation failure from createSourcePicture()

commit 211d4c2d353b5e379716484055a3f58235ea65f4 Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Wed Dec 14 15:55:22 2011 +0000 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: 's avatarChris Wilson <chris@chris-wilson.co.uk> Reviewed-by: 's avatarJeremy Huddleston <jeremyhu@apple.com>
parent 9f9b790f
...@@ -318,6 +318,8 @@ static PicturePtr createSourcePicture(void) ...@@ -318,6 +318,8 @@ static PicturePtr createSourcePicture(void)
sizeof(nxagentPrivPictureRec); sizeof(nxagentPrivPictureRec);
pPicture = (PicturePtr) calloc(1, totalPictureSize); pPicture = (PicturePtr) calloc(1, totalPictureSize);
if (!pPicture)
return 0;
if (pPicture != NULL) if (pPicture != NULL)
{ {
......
...@@ -979,6 +979,8 @@ static PicturePtr createSourcePicture(void) ...@@ -979,6 +979,8 @@ static PicturePtr createSourcePicture(void)
{ {
PicturePtr pPicture; PicturePtr pPicture;
pPicture = (PicturePtr) malloc(sizeof(PictureRec)); pPicture = (PicturePtr) malloc(sizeof(PictureRec));
if (!pPicture)
return 0;
pPicture->pDrawable = 0; pPicture->pDrawable = 0;
pPicture->pFormat = 0; pPicture->pFormat = 0;
pPicture->pNext = 0; pPicture->pNext = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment