The field is expressed in 6 bits so up to 63 bits amplitudes could be
encoded.
Reported and debugged by Uoti Urpala.
---
libavcodec/vorbisdec.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/libavcodec/vorbisdec.c b/libavcodec/vorbisdec.c
index 2d268ad..14e6a21 100644
--- a/libavcodec/vorbisdec.c
+++ b/libavcodec/vorbisdec.c
@@ -1074,13 +1074,14 @@ static int vorbis_floor0_decode(vorbis_context *vc,
{
vorbis_floor0 *vf = &vfu->t0;
float *lsp = vf->lsp;
- unsigned amplitude, book_idx;
+ uint64_t amplitude;
+ unsigned book_idx;
unsigned blockflag = vc->modes[vc->mode_number].blockflag;
if (!vf->amplitude_bits)
return 1;
- amplitude = bitstream_read(&vc->bc, vf->amplitude_bits);
+ amplitude = bitstream_read_63(&vc->bc, vf->amplitude_bits);
if (amplitude > 0) {
float last = 0;
unsigned idx, lsp_len = 0;
@@ -1157,7 +1158,7 @@ static int vorbis_floor0_decode(vorbis_context *vc,
}
/* calculate linear floor value */
- q = exp((((amplitude*vf->amplitude_offset) /
+ q = exp(((((double)amplitude * vf->amplitude_offset) /
(((1 << vf->amplitude_bits) - 1) * sqrt(p + q)))
- vf->amplitude_offset) * .11512925f);
--
2.9.2
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel