[FFmpeg-devel] [PATCH 01/10] avcodec/dca: remove Rice code length limit

foo86 foobaz86 at gmail.com
Fri May 13 11:48:23 CEST 2016


Limit the maximum length of unary part of Rice code by the number of
available bits instead of using an arbitrary constant that happens to be
just large enough to work.
---
 libavcodec/dca_xll.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/dca_xll.c b/libavcodec/dca_xll.c
index 316af27..e43ee6a 100644
--- a/libavcodec/dca_xll.c
+++ b/libavcodec/dca_xll.c
@@ -32,7 +32,7 @@ static int get_linear(GetBitContext *gb, int n)
 
 static int get_rice_un(GetBitContext *gb, int k)
 {
-    unsigned int v = get_unary(gb, 1, 128);
+    unsigned int v = get_unary(gb, 1, get_bits_left(gb));
     return (v << k) | get_bits_long(gb, k);
 }
 
-- 
2.8.1



More information about the ffmpeg-devel mailing list