Skip to content

Length of Scan segment can be off if there are restart markers #8

@mauricefisher64

Description

@mauricefisher64

In reader.rs read_scan_data function should kick out not just for 0x00 but also for any restart segment (RSTn).

             if byte != 0x00 {
                self.current_marker = Some(byte);
                break;
            } else {
                for _ in 0..ff_count {
                    data.push(0xFF);
                }
                data.push(byte);
            }

I think it should be something like this:

fn in_entropy(marker: u8) -> bool {
matches!(marker, 0xd0..=0xd7 | 0x00)
}

              if !in_entropy(byte) {
                self.current_marker = Some(byte);
                break;
            } else {
                for _ in 0..ff_count {
                    data.push(0xFF);
                }
                data.push(byte);
            }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions