From 488bcae4ef7642ffaf891264373396d1db5b887f Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Thu, 6 Oct 2022 18:10:10 +0200 Subject: [PATCH] indeo4: fix picture header parsing --- nihav-indeo/src/codecs/indeo4.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/nihav-indeo/src/codecs/indeo4.rs b/nihav-indeo/src/codecs/indeo4.rs index c20732a..526668b 100644 --- a/nihav-indeo/src/codecs/indeo4.rs +++ b/nihav-indeo/src/codecs/indeo4.rs @@ -76,13 +76,9 @@ impl IndeoXParser for Indeo4Parser { let slice_h; if br.read_bool()? { let idx = br.read(4)? as usize; - if idx < 15 { - slice_w = INDEO4_SLICE_SIZE_TAB[idx]; - slice_h = INDEO4_SLICE_SIZE_TAB[idx]; - } else { - slice_w = width; - slice_h = height; - } + slice_h = if idx < 15 { INDEO4_SLICE_SIZE_TAB[idx] } else { height }; + let idx = br.read(4)? as usize; + slice_w = if idx < 15 { INDEO4_SLICE_SIZE_TAB[idx] } else { width }; } else { slice_w = width; slice_h = height; -- 2.39.5