Fix comparison warnings (#9541)

This commit is contained in:
Hugo van Kemenade 2026-04-06 12:37:24 +03:00 committed by GitHub
commit fcf033bdfb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -49,7 +49,7 @@ ImagingFliDecode(Imaging im, ImagingCodecState state, UINT8 *buf, Py_ssize_t byt
framesize = I32(ptr);
// there can be one pad byte in the framesize
if (bytes + (bytes % 2) < framesize) {
if ((unsigned)(bytes + (bytes % 2)) < framesize) {
return 0;
}
@ -259,7 +259,7 @@ ImagingFliDecode(Imaging im, ImagingCodecState state, UINT8 *buf, Py_ssize_t byt
state->errcode = IMAGING_CODEC_BROKEN;
return -1;
}
if (advance < 0 || advance > bytes) {
if (advance < 0 || advance > (unsigned)bytes) {
state->errcode = IMAGING_CODEC_OVERRUN;
return -1;
}