From 7301516b63d2e5fcd594f1e50a0f7b3b9bb5cadb Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 21 Jul 2015 14:09:01 +0100 Subject: tools/cursor: Error on malloc failure Signed-off-by: Chris Wilson --- tools/cursor.c | 3 +++ 1 file changed, 3 insertions(+) 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++) { -- cgit v1.2.3