Skip to main content

find_jpeg_end

Function find_jpeg_end 

Source
fn find_jpeg_end(bytes: &[u8], start: usize) -> Option<usize>
Expand description

Walk the JPEG marker structure starting at the SOI at bytes[start] and return the byte offset just past the EOI (or the end of the buffer if the file omits the trailing EOI).

The scanner reads marker segments by their declared lengths, then byte-scans only through the entropy-coded section after SOS where FF 00 (byte-stuffing) and FF D0-D7 (restart markers) are skipped.