Skip to content

Commit 5abf125

Browse files
committed
Fix invalid line stride computation causing OOB array accesses
Fixes #125
1 parent a41aef8 commit 5abf125

File tree

2 files changed

+1
-1
lines changed

2 files changed

+1
-1
lines changed

src/decoder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -785,7 +785,7 @@ fn compute_image(components: &[Component],
785785
let height = component.size.height as usize;
786786

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

790790
for y in 0 .. width {
791791
for x in 0 .. height {
331 Bytes
Loading

0 commit comments

Comments
 (0)