Skip to content

Commit

Permalink
Merge pull request #198 from Shivam7-1/patch-2
Browse files Browse the repository at this point in the history
 Multiplication result converted to larger type (Mitigate Arithmetic Overflow in Memory Allocation)
  • Loading branch information
lvandeve authored Apr 11, 2024
2 parents 831773b + 55bdd96 commit ccf9f05
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/zopflipng/lodepng/lodepng_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit ccf9f05

Please sign in to comment.