aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2022-10-05 20:46:14 +0200
committerDaniel Eklöf <daniel@ekloef.se>2022-10-05 20:46:14 +0200
commit43d9d386de9c9c661c5ee2a256ad5d8e8f316e29 (patch)
treec254ed42a1cd06e0dc9226c9de9591b984da148f
parent176e90a1b62bdb776aff97c566dcdda9602a1483 (diff)
downloadwbg-43d9d386de9c9c661c5ee2a256ad5d8e8f316e29.tar.gz
webp: don’t ignore fread() errors
Fixes: ../webp.c:38:5: error: ignoring return value of ‘fread’ declared with attribute ‘warn_unused_result’ [-Werror=unused-result]
-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;
}