change the condition source
diff --git a/src/libbz3.c b/src/libbz3.c
index 9c1d53b..9990322 100644
--- a/src/libbz3.c
+++ b/src/libbz3.c
@@ -206,7 +206,7 @@ PUBLIC_API s32 bz3_decode_block(struct bz3_state * state, u8 * buffer, s32 data_
data_size -= p * 4 + 1;
- if(lzp_size > orig_size || rle_size > orig_size || lzp_size < 0 || rle_size < 0) {
+ if(lzp_size > state->block_size || rle_size > state->block_size || lzp_size < 0 || rle_size < 0) {
state->last_error = BZ3_ERR_MALFORMED_HEADER;
return -1;
}
