aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--webp.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/webp.c b/webp.c
index 2d5346c..b9efbc3 100644
--- a/webp.c
+++ b/webp.c
@@ -35,8 +35,7 @@ webp_load(FILE *fp, const char *path)
}
clearerr(fp);
- fread(file_data, image_size, 1, fp);
- if (ferror(fp)) {
+ if (fread(file_data, image_size, 1, fp) != image_size && ferror(fp)) {
LOG_ERRNO("%s: failed to read", path);
goto out;
}