diff options
author | Andreas Cadhalpun <andreas.cadhalpun@googlemail.com> | 2015-04-18 20:29:13 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2015-05-05 21:59:11 +0200 |
commit | d0e66cb1c7cf2a9ef12963cdc6fd49a35599a9dd (patch) | |
tree | 0b0aca583a26c4d8fea1ed38cbef3a5b6aa31694 /libavcodec | |
parent | 941972d9e9806e30f978e8fd033671fd30a80a07 (diff) | |
download | ffmpeg-d0e66cb1c7cf2a9ef12963cdc6fd49a35599a9dd.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.
CC: libav-stable@libav.org
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit e191aaca44b986816695e3b7ecfae64697fd6631)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 97010c74cbff177b58daf9a092b4e37a7da26f85)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
Diffstat (limited to 'libavcodec')
-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 f7dee7de12..31636df522 100644 --- a/libavcodec/alsdec.c +++ b/libavcodec/alsdec.c @@ -1636,6 +1636,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 |