Skip to content

Commit

Permalink
Update png limits
Browse files Browse the repository at this point in the history
  • Loading branch information
birktj committed Feb 4, 2019
1 parent eaeefa8 commit 2d2838d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/png.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,10 @@ pub struct PNGDecoder<R: Read> {
impl<R: Read> PNGDecoder<R> {
/// Creates a new decoder that decodes from the stream ```r```
pub fn new(r: R) -> ImageResult<PNGDecoder<R>> {
let decoder = png::Decoder::new(r);
let limits = png::Limits {
pixels: std::u64::MAX,
};
let decoder = png::Decoder::new_with_limits(r, limits);
let (_, mut reader) = decoder.read_info()?;
let colortype = reader.output_color_type().into();

Expand Down

0 comments on commit 2d2838d

Please sign in to comment.