From 1f89edc066e8a25e980b5fee00fc6e9b8a2dacd4 Mon Sep 17 00:00:00 2001 From: Sebastian K Date: Sun, 2 Jan 2022 17:28:17 +0300 Subject: [PATCH] fix #123 --- pdf/src/enc.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pdf/src/enc.rs b/pdf/src/enc.rs index 28f82d66..2a0bd8ca 100644 --- a/pdf/src/enc.rs +++ b/pdf/src/enc.rs @@ -272,7 +272,7 @@ fn flate_decode(data: &[u8], params: &LZWFlateParams) -> Result> { let mut out_off = 0; // offset into output buffer let mut last_out_off = 0; // last offset to output buffer - while in_off < inp.len() { + while in_off + stride < inp.len() { let predictor = PredictorType::from_u8(inp[in_off])?; in_off += 1; // +1 because the first byte on each row is predictor