summaryrefslogtreecommitdiff
path: root/libavcodec/flacdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-10-30 01:33:41 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-10-30 01:33:41 +0200
commitd17e7070a099af04a1dc7bc9ddd82f67bfcf9827 (patch)
tree4be589d09939bead88ef3d4e1d5e90fe0348af6c /libavcodec/flacdec.c
parent1af3571e05522df4e71a5b33de05bdb9e953a6c4 (diff)
parent7d1b17b83330aefe2f32a66fe84effe46ae51014 (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: (51 commits) cin audio: use sign_extend() instead of casting to int16_t cin audio: restructure decoding loop to avoid a separate counter variable cin audio: use local variable for delta value cin audio: remove unneeded cast from void* cin audio: validate the channel count cin audio: remove unneeded AVCodecContext pointer from CinAudioContext dsicin: fix several audio-related fields in the CIN demuxer flacdec: use av_get_bytes_per_sample() to get sample size dca: handle errors from dca_decode_block() dca: return error if the frame header is invalid dca: return proper error codes instead of -1 utvideo: handle empty Huffman trees binkaudio: change short to int16_t binkaudio: only decode one block at a time. binkaudio: store interleaved overlap samples in BinkAudioContext. binkaudio: pre-calculate quantization factors binkaudio: add some buffer overread checks. atrac3: support float or int16 output using request_sample_fmt atrac3: add CODEC_CAP_SUBFRAMES capability atrac3: return appropriate error codes instead of -1 ... Conflicts: libavcodec/atrac1.c libavcodec/dca.c libavformat/mov.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
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 cebe3e3e62..c140440436 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");