We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 5f65ebe + 56baf51 commit 7ca9b90Copy full SHA for 7ca9b90
src/decoder.rs
@@ -362,7 +362,14 @@ impl<R: Read> Decoder<R> {
362
// byte which is not equal to 0 or X’FF’ (see Table B.1). Any marker may
363
// optionally be preceded by any number of fill bytes, which are bytes
364
// assigned code X’FF’.
365
- let byte = self.reader.read_u8()?;
+ let mut byte = self.reader.read_u8()?;
366
+
367
+ // Section B.1.1.2
368
+ // "Any marker may optionally be preceded by any number of fill bytes, which are bytes assigned code X’FF’."
369
+ while byte == 0xFF {
370
+ byte = self.reader.read_u8()?;
371
+ }
372
373
if byte != 0x00 && byte != 0xFF {
374
return Ok(Marker::from_u8(byte).unwrap());
375
}
tests/crashtest/images/multiple-0xff-before-eoi.jpg
13.9 KB
0 commit comments