diff options
author | Ronald S. Bultje <rsbultje@gmail.com> | 2012-03-06 20:08:17 -0800 |
---|---|---|
committer | Ronald S. Bultje <rsbultje@gmail.com> | 2012-03-07 09:36:03 -0800 |
commit | f1320dc3bed281bb2f3c5531c52b6a6246e2394a (patch) | |
tree | 40dec42eb0e19ad7633eddf0621b9786f3504563 /libavcodec/pcm-mpeg.c | |
parent | 9487fb4dea3498eb4711eb023f43199f68701b1e (diff) | |
download | ffmpeg-f1320dc3bed281bb2f3c5531c52b6a6246e2394a.tar.gz |
lpcm: fix sample size calculation for 20bit LCPM.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Diffstat (limited to 'libavcodec/pcm-mpeg.c')
-rw-r--r-- | libavcodec/pcm-mpeg.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/pcm-mpeg.c b/libavcodec/pcm-mpeg.c index 9ab6fc3ff0..f010b970bf 100644 --- a/libavcodec/pcm-mpeg.c +++ b/libavcodec/pcm-mpeg.c @@ -156,7 +156,7 @@ static int pcm_bluray_decode_frame(AVCodecContext *avctx, void *data, /* There's always an even number of channels in the source */ num_source_channels = FFALIGN(avctx->channels, 2); - sample_size = (num_source_channels * avctx->bits_per_coded_sample) >> 3; + sample_size = (num_source_channels * (avctx->sample_fmt == AV_SAMPLE_FMT_S16 ? 16 : 24)) >> 3; samples = buf_size / sample_size; /* get output buffer */ |