Closed DerOrfa closed 1 year ago
In detect_preamble in mem.rs
if &buf[0..4] == b"DICM" { return Ok(ReadPreamble::Never); }
is done without checking if buf actually has at least 4 bytes, leading to panic when, for example, trying to read empty files with from_reader_with_all_options and friends.
buf
from_reader_with_all_options
Should return with io::Error.
Thank you for reporting! Would you be able to send in a pull request?
In detect_preamble in mem.rs
is done without checking if
buf
actually has at least 4 bytes, leading to panic when, for example, trying to read empty files withfrom_reader_with_all_options
and friends.Should return with io::Error.