summaryrefslogtreecommitdiffstats
path: root/progs/util/readtex.c
diff options
context:
space:
mode:
authorVinson Lee <[email protected]>2009-11-20 12:11:55 -0800
committerVinson Lee <[email protected]>2009-12-03 17:14:08 -0800
commita0ac8fc7d8d946183ba0506a8134a6e55819e151 (patch)
treedf3ba604291eb46aedf005047809e78993a2363b /progs/util/readtex.c
parent0a6acecb35aa5701ee82cf17c2561c172612cb6e (diff)
progs/util: Exit RawImageGetData early if malloc fails.
Prevents a null pointer deference later on. (cherry picked from commit e26135a744f740430e3dc341fa692544ba99c11e)
Diffstat (limited to 'progs/util/readtex.c')
-rw-r--r--progs/util/readtex.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/progs/util/readtex.c b/progs/util/readtex.c
index 1e1183cf9ac..81cb626e911 100644
--- a/progs/util/readtex.c
+++ b/progs/util/readtex.c
@@ -230,6 +230,7 @@ static void RawImageGetData(rawImageRec *raw, TK_RGBImageRec *final)
final->data = (unsigned char *)malloc((raw->sizeX+1)*(raw->sizeY+1)*4);
if (final->data == NULL) {
fprintf(stderr, "Out of memory!\n");
+ return;
}
ptr = final->data;