You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
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>
This commit is contained in:
committed by
Anton Khirnov
parent
8fc8024ea5
commit
e191aaca44
@@ -1641,6 +1641,12 @@ static av_cold int decode_init(AVCodecContext *avctx)
|
|||||||
avctx->sample_fmt = sconf->resolution > 1
|
avctx->sample_fmt = sconf->resolution > 1
|
||||||
? AV_SAMPLE_FMT_S32 : AV_SAMPLE_FMT_S16;
|
? AV_SAMPLE_FMT_S32 : AV_SAMPLE_FMT_S16;
|
||||||
avctx->bits_per_raw_sample = (sconf->resolution + 1) * 8;
|
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
|
// set maximum Rice parameter for progressive decoding based on resolution
|
||||||
|
Reference in New Issue
Block a user