shithub: dumb

Download patch

ref: d246d1ca85ced770d7ecadebead0576420c3eb7c
parent: f36896a837fada284c12998f89b311641cabc354
author: Christopher Snowhill <[email protected]>
date: Wed Sep 13 14:58:03 EDT 2017

Fix empty pattern so it returns an empty structure.

--- a/src/it/readpsm.c
+++ b/src/it/readpsm.c
@@ -162,7 +162,12 @@
 
 	nrows = data[0] | (data[1] << 8);
 
-	if (!nrows) return 0;
+	if (!nrows) {
+		pattern->n_rows = 0;
+		pattern->n_entries = 0;
+		pattern->entry = NULL;
+		return 0;
+	}
 
 	pattern->n_rows = nrows;