Skip to content

Commit

Permalink
flacdec: use av_get_bytes_per_sample() to get sample size
Browse files Browse the repository at this point in the history
  • Loading branch information
justinruggles committed Oct 29, 2011
1 parent 272fcc3 commit 5bd0343
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libavcodec/flacdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 5bd0343

Please sign in to comment.