summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tools/cursor.c3
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++) {