From 25077ac764819f1b555044e54d6bf6b2a1c79aeb Mon Sep 17 00:00:00 2001 From: Bert Münnich Date: Wed, 29 Oct 2014 14:20:54 +0100 Subject: Fixed segfault when run with -c --- thumbs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'thumbs.c') diff --git a/thumbs.c b/thumbs.c index 5328d3a..a8f498b 100644 --- a/thumbs.c +++ b/thumbs.c @@ -161,7 +161,7 @@ void tns_init(tns_t *tns, const fileinfo_t *files, const int *cnt, int *sel, if (tns == NULL) return; - if (*cnt > 0) { + if (cnt != NULL && *cnt > 0) { tns->thumbs = (thumb_t*) s_malloc(*cnt * sizeof(thumb_t)); memset(tns->thumbs, 0, *cnt * sizeof(thumb_t)); } else { -- cgit v1.2.3-54-g00ecf