Skip to content

Commit e885b4a

Browse files
author
HeroicKatora
authored
Merge pull request #207 from image-rs/oss-fuzz-fix-result
Fix MCU reference in odd decoding order
2 parents 322ed1c + a25b43a commit e885b4a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/decoder.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -582,12 +582,12 @@ impl<R: Read> Decoder<R> {
582582
let mut mcus_left_until_restart = self.restart_interval;
583583
let mut expected_rst_num = 0;
584584
let mut eob_run = 0;
585-
let mut mcu_row_coefficients = Vec::with_capacity(components.len());
585+
let mut mcu_row_coefficients = vec![vec![]; components.len()];
586586

587587
if !is_progressive {
588-
for (_, component) in components.iter().enumerate().filter(|&(i, _)| finished[i]) {
588+
for (i, component) in components.iter().enumerate().filter(|&(i, _)| finished[i]) {
589589
let coefficients_per_mcu_row = component.block_size.width as usize * component.vertical_sampling_factor as usize * 64;
590-
mcu_row_coefficients.push(vec![0i16; coefficients_per_mcu_row]);
590+
mcu_row_coefficients[i] = vec![0i16; coefficients_per_mcu_row];
591591
}
592592
}
593593

0 commit comments

Comments
 (0)