mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-26 18:06:18 +03:00
Malloc check merge/rebase
This commit is contained in:
parent
76605634e6
commit
92a13d975d
|
@ -99,14 +99,16 @@ ImagingPrecompute(int inSize, int outSize, struct filter *filterp,
|
|||
return 0;
|
||||
|
||||
// sizeof(double) should be greater than 0 as well
|
||||
if (outSize > INT_MAX / (2 * sizeof(double)))
|
||||
if (outSize > INT_MAX / (2 * sizeof(int)))
|
||||
return 0;
|
||||
|
||||
/* coefficient buffer */
|
||||
/* malloc check ok, overflow checked above */
|
||||
kk = malloc(outSize * kmax * sizeof(double));
|
||||
if ( ! kk)
|
||||
return 0;
|
||||
|
||||
/* malloc check ok, overflow checked above */
|
||||
xbounds = malloc(outSize * 2 * sizeof(int));
|
||||
if ( ! xbounds) {
|
||||
free(kk);
|
||||
|
|
Loading…
Reference in New Issue
Block a user