aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLode Vandevenne <lvandeve@users.noreply.github.com>2024-04-11 11:55:08 +0200
committerGitHub <noreply@github.com>2024-04-11 11:55:08 +0200
commitccf9f0588d4a4509cb1040310ec122243e670ee6 (patch)
tree2c47f1b9576cf2d7cd6308c0ce4339fd57cddf51
parent831773bc28e318b91a3255fa12c9fcde1606058b (diff)
parent55bdd963ee5c209374140219c275497fddd84bd5 (diff)
downloadzopfli-upstream-master.tar.gz
Merge pull request #198 from Shivam7-1/patch-2upstream-master
Multiplication result converted to larger type (Mitigate Arithmetic Overflow in Memory Allocation)
-rw-r--r--src/zopflipng/lodepng/lodepng_util.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/zopflipng/lodepng/lodepng_util.cpp b/src/zopflipng/lodepng/lodepng_util.cpp
index 574138a..11a6c0f 100644
--- a/src/zopflipng/lodepng/lodepng_util.cpp
+++ b/src/zopflipng/lodepng/lodepng_util.cpp
@@ -1151,7 +1151,7 @@ unsigned convertToXYZ(float* out, float whitepoint[3], const unsigned char* in,
use_icc = validateICC(&icc);
}
- data = (unsigned char*)lodepng_malloc(w * h * (bit16 ? 8 : 4));
+ data = (unsigned char*)lodepng_malloc((size_t)w * (size_t)h * (bit16 ? 8 : 4));
error = lodepng_convert(data, in, &tempmode, mode_in, w, h);
if(error) goto cleanup;