summaryrefslogtreecommitdiffstats
path: root/src/png.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/png.c')
-rw-r--r--src/png.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/png.c b/src/png.c
index 0a89c15..350f960 100644
--- a/src/png.c
+++ b/src/png.c
@@ -47,12 +47,12 @@ int png_load(char *name, struct splash *image, unsigned char **alpha)
char id[4];
fh = fopen(name,"rb");
- if (fh == -1)
+ if (fh == NULL)
return -ENOENT;
- fread(&id, 1, 4, fh);
+ ret = fread(&id, 1, 4, fh);
- if (!(id[1] == 'P' && id[2]=='N' && id[3]=='G'))
+ if (ret != 4 || !(id[1] == 'P' && id[2]=='N' && id[3]=='G'))
return -EINVAL;
rewind(fh);