Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,10 @@ impl<R: Read> Decoder<R> {
previous_marker = marker;
}

if self.frame.is_none() {
return Err(Error::Format("end of image encountered before frame".to_owned()));
}

let frame = self.frame.as_ref().unwrap();

// If we're decoding a progressive jpeg and a component is unfinished, render what we've got
Expand Down
1 change: 1 addition & 0 deletions tests/crashtest/images/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ derive-huffman-codes-overflow.jpg | Found by Pascal Hertleif (@killercup) while
missing-sof.jpg | Found by Corey Farwell (@frewsxcv) when fuzz testing
extraneous-bytes-after-sos.jpg | Scan from brother DSmobile 920DW provided by Filip Lundborg (@filipl)
missing-sos.jpg | Generated in GIMP and manually edited by John Reynolds (@quilan1)
missing-frame-image-1410.jpg | Found by @frewsxcv when fuzzing
1 change: 1 addition & 0 deletions tests/crashtest/images/missing-frame-image-1410.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.