allows for a larger sample size than MIN_CACHE_BITS
---
 libavcodec/alac.c |    9 ++-------
 1 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/libavcodec/alac.c b/libavcodec/alac.c
index 5f2c8a0..0e62adb 100644
--- a/libavcodec/alac.c
+++ b/libavcodec/alac.c
@@ -84,7 +84,7 @@ static inline int decode_scalar(GetBitContext *gb, int k, int 
readsamplesize)
 
     if (x > 8) { /* RICE THRESHOLD */
         /* use alternative encoding */
-        x = get_bits(gb, readsamplesize);
+        x = get_bits_long(gb, readsamplesize);
     } else if (k != 1) {
         int extrabits = show_bits(gb, k);
 
@@ -294,6 +294,7 @@ static int alac_decode_frame(AVCodecContext *avctx, void 
*data,
     hassize = get_bits1(&alac->gb);
 
     alac->extra_bits = get_bits(&alac->gb, 2) << 3;
+    readsamplesize = alac->sample_size - alac->extra_bits + channels - 1;
 
     /* whether the frame is compressed */
     is_compressed = !get_bits1(&alac->gb);
@@ -321,12 +322,6 @@ static int alac_decode_frame(AVCodecContext *avctx, void 
*data,
             alac->output_samples_buffer[ch] = (int32_t *)alac->frame.data[ch];
     }
 
-    readsamplesize = alac->sample_size - alac->extra_bits + channels - 1;
-    if (readsamplesize > MIN_CACHE_BITS) {
-        av_log(avctx, AV_LOG_ERROR, "readsamplesize too big (%d)\n", 
readsamplesize);
-        return -1;
-    }
-
     if (is_compressed) {
         int16_t predictor_coef_table[MAX_CHANNELS][32];
         int predictor_coef_num[MAX_CHANNELS];
-- 
1.7.1

_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to