aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2012-07-09 16:57:22 -0400
committerJustin Ruggles <justin.ruggles@gmail.com>2012-07-19 13:26:48 -0400
commitf3e5a7844bbf13620ca4b6a5e19aa087c9141b15 (patch)
tree76252af437a0f224758890845381f7bc8424d51e /libavcodec
parentbae83f2c746f770f92ab4761f4c7bf38ed5045c5 (diff)
downloadffmpeg-f3e5a7844bbf13620ca4b6a5e19aa087c9141b15.tar.gz
alac: calculate buffer size outside the loop in allocate_buffers()
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/alac.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/alac.c b/libavcodec/alac.c
index 7732f17bcf..7c76c62dfe 100644
--- a/libavcodec/alac.c
+++ b/libavcodec/alac.c
@@ -505,9 +505,9 @@ static av_cold int alac_decode_close(AVCodecContext *avctx)
static int allocate_buffers(ALACContext *alac)
{
int ch;
- for (ch = 0; ch < FFMIN(alac->channels, 2); ch++) {
- int buf_size = alac->max_samples_per_frame * sizeof(int32_t);
+ int buf_size = alac->max_samples_per_frame * sizeof(int32_t);
+ for (ch = 0; ch < FFMIN(alac->channels, 2); ch++) {
FF_ALLOC_OR_GOTO(alac->avctx, alac->predict_error_buffer[ch],
buf_size, buf_alloc_fail);