mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-27 02:16:19 +03:00
Merge pull request #2773 from cgohlke/patch-2
Fix bulletproof code from libc
This commit is contained in:
commit
e4619d0ae5
|
@ -430,8 +430,8 @@ ImagingAllocateArray(Imaging im, int dirty, int block_size)
|
|||
im->blocks[current_block] = block;
|
||||
/* Bulletproof code from libc _int_memalign */
|
||||
aligned_ptr = (char *)(
|
||||
((unsigned long) (block.ptr + arena->alignment - 1)) &
|
||||
-((signed long) arena->alignment));
|
||||
((size_t) (block.ptr + arena->alignment - 1)) &
|
||||
-((Py_ssize_t) arena->alignment));
|
||||
}
|
||||
|
||||
im->image[y] = aligned_ptr + aligned_linesize * line_in_block;
|
||||
|
|
Loading…
Reference in New Issue
Block a user