diff options
author | Andreas Cadhalpun <andreas.cadhalpun@googlemail.com> | 2015-04-18 20:29:13 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-05-06 17:01:34 +0200 |
commit | 645bc997722e5d29a5b874a29fbf857082e09c0a (patch) | |
tree | 0687186578ca63cc93f39ec94c8640ea242ffbe9 /libavcodec/alsdec.c | |
parent | 55376ef978f89141e87fcb72c95ef097c975dce7 (diff) | |
download | ffmpeg-645bc997722e5d29a5b874a29fbf857082e09c0a.tar.gz |
alsdec: limit avctx->bits_per_raw_sample to 32
avctx->bits_per_raw_sample is used in get_sbits_long, which only
supports up to 32 bits.
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 4c2b88678b436f59132386d9be2fc143e3ee480d)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/alsdec.c')
-rw-r--r-- | libavcodec/alsdec.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c index 89cc8a6230..f4715477e4 100644 --- a/libavcodec/alsdec.c +++ b/libavcodec/alsdec.c @@ -1660,6 +1660,12 @@ static av_cold int decode_init(AVCodecContext *avctx) avctx->sample_fmt = sconf->resolution > 1 ? AV_SAMPLE_FMT_S32 : AV_SAMPLE_FMT_S16; avctx->bits_per_raw_sample = (sconf->resolution + 1) * 8; + if (avctx->bits_per_raw_sample > 32) { + av_log(avctx, AV_LOG_ERROR, "Bits per raw sample %d larger than 32.\n", + avctx->bits_per_raw_sample); + ret = AVERROR_INVALIDDATA; + goto fail; + } } // set maximum Rice parameter for progressive decoding based on resolution |