Skip to content

Commit acd8b0c

Browse files
authored
Fix libtiff cleanup (#9002)
1 parent 129267b commit acd8b0c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/libImaging/TiffDecode.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1032,7 +1032,10 @@ ImagingLibTiffEncode(Imaging im, ImagingCodecState state, UINT8 *buffer, int byt
10321032
TRACE(("Encode Error, row %d\n", state->y));
10331033
state->errcode = IMAGING_CODEC_BROKEN;
10341034

1035-
if (!clientstate->fp) {
1035+
if (clientstate->fp) {
1036+
TIFFCleanup(tiff);
1037+
clientstate->tiff = NULL;
1038+
} else {
10361039
free(clientstate->data);
10371040
}
10381041
return -1;

0 commit comments

Comments
 (0)