aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2015-04-24 00:01:43 +0200
committerMichael Niedermayer <michaelni@gmx.at>2015-04-25 15:06:55 +0200
commitdfe37f2be202a0db5b1b06552ea2aaf33eb70628 (patch)
treead2662c2edf2f7fcddfa8bbebe57492157190c1c
parentb16a6c67099852f5c1485b70611a7803acd9a782 (diff)
downloadffmpeg-dfe37f2be202a0db5b1b06552ea2aaf33eb70628.tar.gz
alac: reject rice_limit 0 if compression is used
If rice_limit is 0, k can be 0 in decode_scalar, which calls show_bits(gb, k). Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 4b657a1b1eedcf38bcf36e89a2f4be6f76b5ce09) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/alac.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/alac.c b/libavcodec/alac.c
index aec7bb4e4e..f5a5b86145 100644
--- a/libavcodec/alac.c
+++ b/libavcodec/alac.c
@@ -316,6 +316,11 @@ static int decode_element(AVCodecContext *avctx, AVFrame *frame, int ch_index,
int lpc_quant[2];
int rice_history_mult[2];
+ if (!alac->rice_limit) {
+ avpriv_request_sample(alac->avctx, "Compression with rice limit 0");
+ return AVERROR(ENOSYS);
+ }
+
decorr_shift = get_bits(&alac->gb, 8);
decorr_left_weight = get_bits(&alac->gb, 8);