summaryrefslogtreecommitdiff
path: root/libavcodec/flacdec.c
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2011-10-27 14:29:28 -0400
committerJustin Ruggles <justin.ruggles@gmail.com>2011-10-29 16:05:25 -0400
commit5bd0343bee1ed3df9cae1093bd909d07d07fa145 (patch)
tree0bebaacfce5be5ca9673063644ef92f797a273a0 /libavcodec/flacdec.c
parent272fcc32bb0d3b552390d15213201756fdf27d74 (diff)
flacdec: use av_get_bytes_per_sample() to get sample size
Diffstat (limited to 'libavcodec/flacdec.c')
-rw-r--r--libavcodec/flacdec.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/flacdec.c b/libavcodec/flacdec.c
index 633a1386ae..95cf2bccb4 100644
--- a/libavcodec/flacdec.c
+++ b/libavcodec/flacdec.c
@@ -587,7 +587,8 @@ static int flac_decode_frame(AVCodecContext *avctx,
bytes_read = (get_bits_count(&s->gb)+7)/8;
/* check if allocated data size is large enough for output */
- output_size = s->blocksize * s->channels * (s->is32 ? 4 : 2);
+ output_size = s->blocksize * s->channels *
+ av_get_bytes_per_sample(avctx->sample_fmt);
if (output_size > alloc_data_size) {
av_log(s->avctx, AV_LOG_ERROR, "output data size is larger than "
"allocated data size\n");