aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/alac.c
diff options
context:
space:
mode:
authorLimin Wang <lance.lmwang@gmail.com>2020-05-29 22:38:31 +0800
committerLimin Wang <lance.lmwang@gmail.com>2020-06-13 06:59:19 +0800
commitbdbe3f06a21c257adc1ad7488ed87992b23be490 (patch)
tree4e14bfb2a2417cf84168d6fab4de3d36aabfd08a /libavcodec/alac.c
parent67de2d6a8c9ae9ddacd36a2a05b8f96f3c9bad46 (diff)
downloadffmpeg-bdbe3f06a21c257adc1ad7488ed87992b23be490.tar.gz
avcodec/alac: remove FF_ALLOC_OR_GOTO and gotos label
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Diffstat (limited to 'libavcodec/alac.c')
-rw-r--r--libavcodec/alac.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/libavcodec/alac.c b/libavcodec/alac.c
index 3b41373f47..bf05406230 100644
--- a/libavcodec/alac.c
+++ b/libavcodec/alac.c
@@ -489,6 +489,7 @@ static int allocate_buffers(ALACContext *alac)
{
int ch;
unsigned buf_size = alac->max_samples_per_frame * sizeof(int32_t);
+ unsigned extra_buf_size = buf_size + AV_INPUT_BUFFER_PADDING_SIZE;
for (ch = 0; ch < 2; ch++) {
alac->predict_error_buffer[ch] = NULL;
@@ -497,21 +498,19 @@ static int allocate_buffers(ALACContext *alac)
}
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);
+ if (!(alac->predict_error_buffer[ch] = av_malloc(buf_size)))
+ return AVERROR(ENOMEM);
alac->direct_output = alac->sample_size > 16;
if (!alac->direct_output) {
- FF_ALLOC_OR_GOTO(alac->avctx, alac->output_samples_buffer[ch],
- buf_size + AV_INPUT_BUFFER_PADDING_SIZE, buf_alloc_fail);
+ if (!(alac->output_samples_buffer[ch] = av_malloc(extra_buf_size)))
+ return AVERROR(ENOMEM);
}
- FF_ALLOC_OR_GOTO(alac->avctx, alac->extra_bits_buffer[ch],
- buf_size + AV_INPUT_BUFFER_PADDING_SIZE, buf_alloc_fail);
+ if (!(alac->extra_bits_buffer[ch] = av_malloc(extra_buf_size)))
+ return AVERROR(ENOMEM);
}
return 0;
-buf_alloc_fail:
- return AVERROR(ENOMEM);
}
static int alac_set_info(ALACContext *alac)