Skip to content

Commit 4e18d8d

Browse files
committed
fix wrong vec initialization
1 parent a094090 commit 4e18d8d

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/decoder/lossless.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@ use error::{Error, Result};
33
use huffman::HuffmanDecoder;
44
use marker::Marker;
55
use parser::Predictor;
6-
use parser::{
7-
Component, FrameInfo,
8-
ScanInfo,
9-
};
6+
use parser::{Component, FrameInfo, ScanInfo};
107
use std::io::Read;
118

129
impl<R: Read> Decoder<R> {
@@ -19,7 +16,7 @@ impl<R: Read> Decoder<R> {
1916
let ncomp = scan.component_indices.len();
2017
let npixel = frame.image_size.height as usize * frame.image_size.width as usize;
2118
assert!(ncomp <= MAX_COMPONENTS);
22-
let mut results = vec![vec!(0, npixel); ncomp];
19+
let mut results = vec![vec![0u16; npixel]; ncomp];
2320

2421
let components: Vec<Component> = scan
2522
.component_indices

0 commit comments

Comments
 (0)