8000 Possible fix to #17. · coderforlife/ms-compress@8ba2fb0 · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit 8ba2fb0

Browse files
committed
Possible fix to #17.
Because the inflate methods return MSCOMP_STREAM_END or MSCOMP_POSSIBLE_STREAM_END instead of MSCOMP_OK when they are at a stopping point, MSCOMP_OK actually becomes an error message (that gets translated to MSCOMP_BUF_ERROR). A similar method was already in use for ALL_AT_ONCE_WRAPPER_COMPRESS.
1 parent 90829b8 commit 8ba2fb0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/mscomp/internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ typedef const_byte* RESTRICT const_rest_bytes;
611611
strm.out = out; \
612612
strm.out_avail = *_out_len; \
613613
status = name##_inflate(&strm); \
614-
if (UNLIKELY(status < 0)) { name##_inflate_end(&strm); } \
614+
if (UNLIKELY(status <= MSCOMP_OK)) { name##_inflate_end(&strm); if (status == MSCOMP_OK) { status = MSCOMP_BUF_ERROR; } } \
615615
else if (LIKELY((status = name##_inflate_end(&strm)) == MSCOMP_OK)) { *_out_len = strm.out_total; } \
616616
return status; \
617617
}

0 commit comments

Comments
 (0)
0