mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-28 10:56:18 +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;
|
im->blocks[current_block] = block;
|
||||||
/* Bulletproof code from libc _int_memalign */
|
/* Bulletproof code from libc _int_memalign */
|
||||||
aligned_ptr = (char *)(
|
aligned_ptr = (char *)(
|
||||||
((unsigned long) (block.ptr + arena->alignment - 1)) &
|
((size_t) (block.ptr + arena->alignment - 1)) &
|
||||||
-((signed long) arena->alignment));
|
-((Py_ssize_t) arena->alignment));
|
||||||
}
|
}
|
||||||
|
|
||||||
im->image[y] = aligned_ptr + aligned_linesize * line_in_block;
|
im->image[y] = aligned_ptr + aligned_linesize * line_in_block;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user