mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-13 18:56:17 +03:00
Initialize offset memory for PyImagingPhotoPut.
When using image mode "1" or "L" block.offset[3] is never initialized. In some use cases the block is passed to Tk_PhotoPutBlock (https://github.com/tcltk/tk/blob/master/generic/tkImgPhoto.c#L2752) and block.offset[3] is stored in alphaoffset which is later referenced.
This commit is contained in:
parent
8deaebd5e0
commit
1743ac4734
|
@ -114,7 +114,7 @@ PyImagingPhotoPut(ClientData clientdata, Tcl_Interp* interp,
|
|||
|
||||
if (strcmp(im->mode, "1") == 0 || strcmp(im->mode, "L") == 0) {
|
||||
block.pixelSize = 1;
|
||||
block.offset[0] = block.offset[1] = block.offset[2] = 0;
|
||||
block.offset[0] = block.offset[1] = block.offset[2] = block.offset[3] = 0;
|
||||
} else if (strncmp(im->mode, "RGB", 3) == 0) {
|
||||
block.pixelSize = 4;
|
||||
block.offset[0] = 0;
|
||||
|
|
Loading…
Reference in New Issue
Block a user