Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.

Commit

Permalink
mcu_prog: Add extra space when decoding interleaved images.
Browse files Browse the repository at this point in the history
Ensures #8 (comment) decodes correctly
  • Loading branch information
etemesi254 committed Aug 7, 2022
1 parent 0d64448 commit bc84f55
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/mcu_prog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,13 @@ impl Decoder
let y = &block[0];
let cb = &block[1];
let cr = &block[2];

let extra_space = usize::from(self.interleaved) * 128 * usize::from(self.height()) * self.output_colorspace.num_components();


let capacity = usize::from(self.info.width + 8) * usize::from(self.info.height + 8);

let mut out_vector = vec![0_u8; capacity * self.output_colorspace.num_components()];
let mut out_vector = vec![0_u8; capacity * self.output_colorspace.num_components()+extra_space];


// Things we need for multithreading.
Expand Down

0 comments on commit bc84f55

Please sign in to comment.