From 724e5e8c801ce82f4189414f9371f9f70267c99c Mon Sep 17 00:00:00 2001 From: zroug <37004975+zroug@users.noreply.github.com> Date: Mon, 27 Aug 2018 23:05:16 +0200 Subject: [PATCH] Fixed: Decoder::expand_strip might not read the full strip --- src/decoder/mod.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/decoder/mod.rs b/src/decoder/mod.rs index 2495de4..2c7bdcd 100644 --- a/src/decoder/mod.rs +++ b/src/decoder/mod.rs @@ -422,7 +422,8 @@ impl Decoder { (ColorType:: RGB(8), DecodingBuffer::U8(ref mut buffer)) | (ColorType::RGBA(8), DecodingBuffer::U8(ref mut buffer)) | (ColorType::CMYK(8), DecodingBuffer::U8(ref mut buffer)) => { - try!(reader.read(&mut buffer[..bytes])) + try!(reader.read_exact(&mut buffer[..bytes])); + bytes } (ColorType::RGBA(16), DecodingBuffer::U16(ref mut buffer)) | (ColorType:: RGB(16), DecodingBuffer::U16(ref mut buffer)) => {