Skip to content

Commit

Permalink
Implement a fix for #42
Browse files Browse the repository at this point in the history
  • Loading branch information
est31 committed Feb 26, 2019
1 parent 2c64469 commit 489948d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/audio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,11 @@ fn residue_packet_read_partition(rdr :&mut BitpackCursor, codebook :&Codebook,
let mut i = 0;
while i < partition_size {
let entries = try!(rdr.read_huffman_vq(codebook));
let vs = &mut vec_v[i..(i + entries.len())];
let vs = if let Some(vs) = vec_v.get_mut(i..(i + entries.len())) {
vs
} else {
break;
};

for (v, e) in vs.iter_mut().zip(entries.iter()) {
*v += *e;
Expand Down

0 comments on commit 489948d

Please sign in to comment.