Skip to content

Commit 7608000

Browse files
committed
Avoid repeating indices while slicing
See: #127 (comment)
1 parent 7cd3bca commit 7608000

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/decoder.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -790,8 +790,8 @@ fn compute_image(components: &[Component],
790790
for y in 0 .. height {
791791
let destination_idx = y * width;
792792
let source_idx = y * line_stride;
793-
let destination = &mut buffer[destination_idx..destination_idx + width];
794-
let source = &data[0][source_idx..source_idx + width];
793+
let destination = &mut buffer[destination_idx..][..width];
794+
let source = &data[0][source_idx..][..width];
795795
destination.copy_from_slice(source);
796796
}
797797

0 commit comments

Comments
 (0)