summaryrefslogtreecommitdiff
path: root/libavcodec/alac.c
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-24 01:15:41 +0200
commit4b657a1b1eedcf38bcf36e89a2f4be6f76b5ce09 (patch)
treeae7bd037cd67d33d767556169245df19397d5c43 /libavcodec/alac.c
parent802c0af68f22b0c3cd4ad3d29f5094e9377995de (diff)
downloadffmpeg-4b657a1b1eedcf38bcf36e89a2f4be6f76b5ce09.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>
Diffstat (limited to 'libavcodec/alac.c')
-rw-r--r--libavcodec/alac.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/alac.c b/libavcodec/alac.c
index ffd2d77d7c..ada7c73c55 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);