Fixed libtiff cleanup

This commit is contained in:
Andrew Murray 2025-06-07 22:19:21 +10:00
parent f3b05d6fab
commit c276214025

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;