summaryrefslogtreecommitdiff
path: root/libavcodec/atrac3.c
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2012-10-18 23:51:37 -0400
committerJustin Ruggles <justin.ruggles@gmail.com>2012-10-22 10:10:08 -0400
commita1f4cd371ac7ff9fea6f0d3072fc886380160844 (patch)
treeba9b92136c2f8ebdc932668f340f31c41f2f3d4a /libavcodec/atrac3.c
parent808686fc1ea66c33c585dbc5d891bacbd983a27d (diff)
atrac3: replace a calculation with FFALIGN()
This allocates 4 bytes less than the previous code if avctx->block_align is a multiple of 4, but the extra 4 bytes is not really needed.
Diffstat (limited to 'libavcodec/atrac3.c')
-rw-r--r--libavcodec/atrac3.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/libavcodec/atrac3.c b/libavcodec/atrac3.c
index 66c672a519..9cf989246b 100644
--- a/libavcodec/atrac3.c
+++ b/libavcodec/atrac3.c
@@ -947,8 +947,7 @@ static av_cold int atrac3_decode_init(AVCodecContext *avctx)
if (avctx->block_align >= UINT_MAX / 2)
return AVERROR(EINVAL);
- q->decoded_bytes_buffer = av_mallocz(avctx->block_align +
- (4 - avctx->block_align % 4) +
+ q->decoded_bytes_buffer = av_mallocz(FFALIGN(avctx->block_align, 4) +
FF_INPUT_BUFFER_PADDING_SIZE);
if (q->decoded_bytes_buffer == NULL)
return AVERROR(ENOMEM);