cgetpixel_mb constant size buffer

This commit is contained in:
Junxiao Shi 2024-06-01 22:41:57 +00:00
parent 76d336d21a
commit ed15ed9737
2 changed files with 3 additions and 2 deletions

View File

@ -435,7 +435,8 @@ float16tofloat32(const FLOAT16 in) {
static inline PyObject *
getpixel_mb(Imaging im, ImagingAccess access, int x, int y) {
UINT8 pixel[im->pixelsize];
UINT8 pixel[sizeof(INT32) * 6];
assert(im->pixelsize <= sizeof(pixel));
access->get_pixel(im, x, y, &pixel);
PyObject *tuple = PyTuple_New(im->bands);

View File

@ -198,7 +198,7 @@ ImagingNewPrologueSubtype(
}
im->bands = bands;
im->depth = depth;
im->pixelsize = depth * bands;
im->pixelsize = depth / CHAR_BIT * bands;
im->linesize = xsize * im->pixelsize;
im->type = IMAGING_TYPE_MB;