]> git.draconx.ca Git - liblbx.git/blobdiff - src/image.c
Fix segfault on EOF in lbximg_fopen().
[liblbx.git] / src / image.c
index 81f66e015e6e05e602dfca397d78901f7355d959..e1fd3bbe062d8390451a53ddeec965df8d863285 100644 (file)
@@ -29,7 +29,7 @@ struct lbx_image {
 
 struct lbx_image *lbximg_fopen(FILE *f)
 {
-       struct lbx_image tmp = {.f = f}, *new;
+       struct lbx_image tmp = {.f = f}, *new = NULL;
 
        if (fread(&tmp.width,  sizeof tmp.width,   1, f) != 1) goto readerr;
        if (fread(&tmp.height, sizeof tmp.height,  1, f) != 1) goto readerr;