[FFmpeg-devel] [PATCH v4 10/24] avcodec/apedec: remove FF_ALLOC_OR_GOTO and gotos lable
lance.lmwang at gmail.com
lance.lmwang at gmail.com
Tue Jun 2 18:26:44 EEST 2020
From: Limin Wang <lance.lmwang at gmail.com>
Signed-off-by: Limin Wang <lance.lmwang at gmail.com>
---
libavcodec/apedec.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c
index 0bee9d8..a817673 100644
--- a/libavcodec/apedec.c
+++ b/libavcodec/apedec.c
@@ -262,9 +262,8 @@ static av_cold int ape_decode_init(AVCodecContext *avctx)
for (i = 0; i < APE_FILTER_LEVELS; i++) {
if (!ape_filter_orders[s->fset][i])
break;
- FF_ALLOC_OR_GOTO(avctx, s->filterbuf[i],
- (ape_filter_orders[s->fset][i] * 3 + HISTORY_SIZE) * 4,
- filter_alloc_fail);
+ if (!(s->filterbuf[i] = av_malloc((ape_filter_orders[s->fset][i] * 3 + HISTORY_SIZE) * 4)))
+ return AVERROR(ENOMEM);
}
if (s->fileversion < 3860) {
@@ -300,8 +299,6 @@ static av_cold int ape_decode_init(AVCodecContext *avctx)
avctx->channel_layout = (avctx->channels==2) ? AV_CH_LAYOUT_STEREO : AV_CH_LAYOUT_MONO;
return 0;
-filter_alloc_fail:
- return AVERROR(ENOMEM);
}
/**
--
1.8.3.1
More information about the ffmpeg-devel
mailing list