[FFmpeg-cvslog] alac: reject rice_limit 0 if compression is used

Andreas Cadhalpun git at videolan.org
Mon Jun 1 13:11:21 CEST 2015


ffmpeg | branch: release/2.2 | Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com> | Fri Apr 24 00:01:43 2015 +0200| [6443db085a192baf1ede12ca80e2bbd7be3ca4fc] | committer: Michael Niedermayer

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 at googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit 4b657a1b1eedcf38bcf36e89a2f4be6f76b5ce09)

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6443db085a192baf1ede12ca80e2bbd7be3ca4fc
---

 libavcodec/alac.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/alac.c b/libavcodec/alac.c
index 1e28efd..37dcc3a 100644
--- a/libavcodec/alac.c
+++ b/libavcodec/alac.c
@@ -311,6 +311,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);
 



More information about the ffmpeg-cvslog mailing list