Browse Source

Fixed issue where errorcode would not propogate back to Managed if thrown during ReadZStream. (#21571)

Alex Thibodeau 2 years ago
parent
commit
7f69cba5b9
1 changed files with 2 additions and 0 deletions
  1. 2 0
      support/zlib-helper.c

+ 2 - 0
support/zlib-helper.c

@@ -194,6 +194,8 @@ ReadZStream (ZStream *stream, guchar *buffer, gint length)
 	while (zs->avail_out > 0) {
 		if (zs->avail_in == 0) {
 			n = stream->func (stream->buffer, BUFFER_SIZE, stream->gchandle);
+			if (n == MONO_EXCEPTION)
+				return n;
 			n = n < 0 ? 0 : n;
 			stream->total_in += n;
 			zs->next_in = stream->buffer;