1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-01-10 07:20:56 +00:00

fix(core): fix jpeg size parsing

[no changelog]
This commit is contained in:
tychovrahe 2024-12-31 15:59:47 +01:00 committed by TychoVrahe
parent 0a91d2e463
commit 2d051ffefd

View File

@ -153,8 +153,8 @@ impl JpegInfo {
ofs += match marker { ofs += match marker {
M_SOI => 0, M_SOI => 0,
M_SOF0 => { M_SOF0 => {
let w = image.read_u16_be(ofs + 3)? as i16; let h = image.read_u16_be(ofs + 3)? as i16;
let h = image.read_u16_be(ofs + 5)? as i16; let w = image.read_u16_be(ofs + 5)? as i16;
// Number of components // Number of components
let nc = image.read_u8(ofs + 7)?; let nc = image.read_u8(ofs + 7)?;
if (nc != 1) && (nc != 3) { if (nc != 1) && (nc != 3) {