From fdd68493ebf7c0e1f367ccd3ec3e6c6848d21eff Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Sat, 28 Nov 2020 12:01:33 +0100 Subject: [PATCH] maximum FLAC order is 32 --- nihav-llaudio/src/codecs/flac.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nihav-llaudio/src/codecs/flac.rs b/nihav-llaudio/src/codecs/flac.rs index 55cd6bb..0ca80aa 100644 --- a/nihav-llaudio/src/codecs/flac.rs +++ b/nihav-llaudio/src/codecs/flac.rs @@ -121,7 +121,7 @@ fn apply_fixed_predictor(dst: &mut [i32], order: usize) { }; } -fn apply_lpc(dst: &mut [i32], filt: &[i32; 16], order: usize, shift: u8) { +fn apply_lpc(dst: &mut [i32], filt: &[i32; 32], order: usize, shift: u8) { for i in order..dst.len() { let mut sum = 0i64; for (coef, filt) in dst[i - order..].iter().take(order).zip(filt.iter()) { @@ -213,7 +213,7 @@ impl FlacDecoder { let precision = br.read(4)? as u8 + 1; validate!(precision < 16); let shift = br.read(5)? as u8; - let mut filter = [0i32; 16]; + let mut filter = [0i32; 32]; for el in filter[..order].iter_mut().rev() { *el = br.read_s(precision)?; } -- 2.39.5