mirror of
https://github.com/WerWolv/ImHex-Patterns.git
synced 2026-03-27 23:37:04 -05:00
patterns/jpeg: Simplify EOI marker search (#272)
Co-authored-by: Nik <werwolv98@gmail.com>
This commit is contained in:
@@ -105,10 +105,7 @@ fn sof0_component_read(SOF0Component c) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
fn get_eoi_marker_position() {
|
fn get_eoi_marker_position() {
|
||||||
u32 pos = std::mem::find_sequence_in_range(0, $, std::mem::size(), 0xFF);
|
u32 pos = std::mem::find_sequence_in_range(0, $, std::mem::size(), 0xFF, 0xD9);
|
||||||
while (std::mem::read_unsigned(pos + 1, 1) != 0xD9) {
|
|
||||||
pos = std::mem::find_sequence_in_range(0, pos + 1, std::mem::size() + 1, 0xFF);
|
|
||||||
}
|
|
||||||
return pos;
|
return pos;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user