diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2015-07-21 14:09:01 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2015-07-21 14:09:01 +0100 |
commit | 7301516b63d2e5fcd594f1e50a0f7b3b9bb5cadb (patch) | |
tree | 9544dab51fbe6a7a9782080bae284d12210a91e8 /tools | |
parent | 18b947b99919e7a1b8a80eda47fa29bf8675bc69 (diff) |
tools/cursor: Error on malloc failure
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/cursor.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/cursor.c b/tools/cursor.c index 31d45d74..6f4e3f8c 100644 --- a/tools/cursor.c +++ b/tools/cursor.c @@ -78,6 +78,9 @@ int main(int argc, char **argv) src = cur->pixels; rows = malloc(cur->height*sizeof(png_byte*)); + if (rows == NULL) + return 3; + for (y = 0; y < cur->height; y++) { rows[y] = malloc(cur->width * 4); for (x = 0; x < cur->width; x++) { |