summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers
diff options
context:
space:
mode:
authorPatrick Rudolph <[email protected]>2015-01-15 09:18:25 +0100
committerAxel Davy <[email protected]>2015-02-06 00:07:19 +0100
commitfaf94f6eeaccf093025ad6f1e2bd9df6eafbe969 (patch)
tree1280b367b3bff595d91c64db8187490de5297f25 /src/gallium/state_trackers
parent75676886e4dd43c1e9ab85891d1ab6b2bf1fad92 (diff)
st/nine: Missing sanity check for CALLOC return E_OUTOFMEMORY if allocation of usage_map fails
Reviewed-by: Axel Davy <[email protected]> Signed-off-by: Patrick Rudolph <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers')
-rw-r--r--src/gallium/state_trackers/nine/vertexdeclaration9.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gallium/state_trackers/nine/vertexdeclaration9.c b/src/gallium/state_trackers/nine/vertexdeclaration9.c
index 4aea1169be3..08b95e22fc4 100644
--- a/src/gallium/state_trackers/nine/vertexdeclaration9.c
+++ b/src/gallium/state_trackers/nine/vertexdeclaration9.c
@@ -192,7 +192,7 @@ NineVertexDeclaration9_ctor( struct NineVertexDeclaration9 *This,
This->decls = CALLOC(This->nelems+1, sizeof(D3DVERTEXELEMENT9));
This->elems = CALLOC(This->nelems, sizeof(struct pipe_vertex_element));
This->usage_map = CALLOC(This->nelems, sizeof(uint16_t));
- if (!This->decls || !This->elems) { return E_OUTOFMEMORY; }
+ if (!This->decls || !This->elems || !This->usage_map) { return E_OUTOFMEMORY; }
memcpy(This->decls, pElements, sizeof(D3DVERTEXELEMENT9)*(This->nelems+1));
for (i = 0; i < This->nelems; ++i) {