Commit cd0cfdc0 authored by Michael Niedermayer's avatar Michael Niedermayer

pcm-mpeg: Check for valid bps.

The code only supports 16 and 24 bps currently, 20bps causes
out of array reads.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent f83687bc
......@@ -69,8 +69,8 @@ static int pcm_bluray_parse_header(AVCodecContext *avctx,
/* get the sample depth and derive the sample format from it */
avctx->bits_per_coded_sample = bits_per_samples[header[3] >> 6];
if (!avctx->bits_per_coded_sample) {
av_log(avctx, AV_LOG_ERROR, "unsupported sample depth (0)\n");
if (avctx->bits_per_coded_sample == 16 || avctx->bits_per_coded_sample == 24) {
av_log(avctx, AV_LOG_ERROR, "unsupported sample depth (%d)\n", avctx->bits_per_coded_sample);
return -1;
}
avctx->sample_fmt = avctx->bits_per_coded_sample == 16 ? AV_SAMPLE_FMT_S16 :
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment