Fix libtiff cleanup (#9002)

This commit is contained in:
Andrew Murray 2025-06-25 09:09:31 +10:00 committed by GitHub
parent 129267bc82
commit acd8b0c2ac
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1032,7 +1032,10 @@ ImagingLibTiffEncode(Imaging im, ImagingCodecState state, UINT8 *buffer, int byt
TRACE(("Encode Error, row %d\n", state->y));
state->errcode = IMAGING_CODEC_BROKEN;
if (!clientstate->fp) {
if (clientstate->fp) {
TIFFCleanup(tiff);
clientstate->tiff = NULL;
} else {
free(clientstate->data);
}
return -1;