Skip to content

Commit 53121e3

Browse files
authored
Revert 0xFF marker check
1 parent 0c6f5a2 commit 53121e3

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/decoder.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,14 @@ impl<R: Read> Decoder<R> {
362362
// byte which is not equal to 0 or X’FF’ (see Table B.1). Any marker may
363363
// optionally be preceded by any number of fill bytes, which are bytes
364364
// assigned code X’FF’.
365-
let byte = self.reader.read_u8()?;
365+
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+
366373
if byte != 0x00 && byte != 0xFF {
367374
return Ok(Marker::from_u8(byte).unwrap());
368375
}

0 commit comments

Comments
 (0)