summaryrefslogtreecommitdiff
path: root/libavcodec/alsdec.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/alsdec.c')
-rw-r--r--libavcodec/alsdec.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c
index 814a0549b2..093d08372e 100644
--- a/libavcodec/alsdec.c
+++ b/libavcodec/alsdec.c
@@ -1641,6 +1641,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