Skip to content

Commit

Permalink
Fix invalid line stride computation causing OOB array accesses
Browse files Browse the repository at this point in the history
  • Loading branch information
lovasoa committed Dec 9, 2019
1 parent a41aef8 commit 5abf125
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,7 @@ fn compute_image(components: &[Component],
let height = component.size.height as usize;

let mut buffer = vec![0u8; width * height];
let line_stride = width * component.dct_scale;
let line_stride = component.block_size.width as usize * component.dct_scale;

for y in 0 .. width {
for x in 0 .. height {
Expand Down
Binary file added tests/crashtest/images/single_chan.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 5abf125

Please sign in to comment.