From 9e97f99d3e97afb62b6f84f334e9a5a9134ac8f4 Mon Sep 17 00:00:00 2001 From: Aous Naman Date: Fri, 20 Sep 2024 22:48:46 +1000 Subject: [PATCH] Hopefully, this will remove warnings. --- src/apps/others/ojph_img_io.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/apps/others/ojph_img_io.cpp b/src/apps/others/ojph_img_io.cpp index a7a91b7..d812025 100644 --- a/src/apps/others/ojph_img_io.cpp +++ b/src/apps/others/ojph_img_io.cpp @@ -636,7 +636,8 @@ namespace ojph { if (comp_num == 0) { si64 loc = start_of_data; - loc += (size_t)(height-1 - cur_line) * num_comps * width * sizeof(float); + loc += (size_t)(height-1 - cur_line) * (size_t)num_comps + * (size_t)width * sizeof(float); if (ojph_fseek(fh, loc, SEEK_SET) != 0) { close(); @@ -644,7 +645,7 @@ namespace ojph { } size_t result = fread(temp_buf, sizeof(float), (size_t)num_comps * (size_t)width, fh); - if (result != num_comps * width) + if (result != (size_t)num_comps * (size_t)width) { close(); OJPH_ERROR(0x03000062, "Not enough data in file %s", fname);