From 43d9d386de9c9c661c5ee2a256ad5d8e8f316e29 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Wed, 5 Oct 2022 20:46:14 +0200 Subject: webp: don’t ignore fread() errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: ../webp.c:38:5: error: ignoring return value of ‘fread’ declared with attribute ‘warn_unused_result’ [-Werror=unused-result] --- webp.c | 3 +-- 1 file changed, 1 insertion(+), 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; } -- cgit v1.2.3