Skip to content

Commit d22efc8

Browse files
committed
Make sure state remains consistent on exception
1 parent 8a5b758 commit d22efc8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/isal/igzip_lib.pyx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,9 @@ cdef class IgzipDecompressor:
487487
memcpy(self.input_buffer, self.stream.next_in, self.avail_in_real)
488488
self.stream.next_in = self.input_buffer
489489
return PyBytes_FromStringAndSize(<char*>obuf, self.stream.next_out - obuf)
490+
except:
491+
self.stream.next_in = NULL
492+
raise
490493
finally:
491494
PyBuffer_Release(buffer)
492495
PyMem_Free(obuf)

0 commit comments

Comments
 (0)