diff --git a/dev/cmp/tests/vals.rs b/dev/cmp/tests/vals.rs index 752fc3c..0072692 100644 --- a/dev/cmp/tests/vals.rs +++ b/dev/cmp/tests/vals.rs @@ -70,9 +70,12 @@ fn test_libnogg_vals() { // We can't cmp the output here because native // libvorbis doesn't accept the file as valid ensure_okay!("single-code-nonsparse.ogg"); - //cmp_output!("single-code-ordered.ogg", 0); - // TODO fix this - //cmp_output!("single-code-sparse.ogg", 0); + ensure_okay!("single-code-ordered.ogg"); + // TODO get this number down to zero + // This test is ensuring already though that + // the file decodes without errors, which wasn't + // the case until a bug in lewton got fixed. + cmp_output!("single-code-sparse.ogg", 25); cmp_output!("sketch008-floor0.ogg", 4); cmp_output!("sketch008.ogg", 0); cmp_output!("sketch039.ogg", 0); diff --git a/src/header.rs b/src/header.rs index 363f021..ac02184 100644 --- a/src/header.rs +++ b/src/header.rs @@ -707,7 +707,7 @@ fn read_codebook(rdr :&mut BitpackCursor) -> Result { } current_entry += number; current_length += 1; - if current_length as u32 > codebook_entries { + if current_entry as u32 > codebook_entries { try!(Err(HeaderReadError::HeaderBadFormat)); } }