Skip to content

Commit

Permalink
Address issue #44 (#45)
Browse files Browse the repository at this point in the history
Address issue #44
  • Loading branch information
BenSandeen authored and est31 committed Mar 2, 2019
1 parent 0d13bc4 commit 9078060
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,11 @@ fn read_floor(rdr :&mut BitpackCursor, codebook_cnt :u16, blocksizes :(u8, u8))
let mut floor0_book_list = Vec::with_capacity(
convert_to_usize!(floor0_number_of_books, u8));
for _ in 0 .. floor0_number_of_books {
floor0_book_list.push(try!(rdr.read_u8()));
let value = try!(rdr.read_u8());
if value > codebook_cnt as u8 {
try!(Err(HeaderReadError::HeaderBadFormat));
}
floor0_book_list.push(value);
}
Ok(Floor::TypeZero(FloorTypeZero {
floor0_order,
Expand Down

0 comments on commit 9078060

Please sign in to comment.