aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/iirfilter.c
diff options
context:
space:
mode:
authorLimin Wang <lance.lmwang@gmail.com>2020-06-01 23:13:32 +0800
committerLimin Wang <lance.lmwang@gmail.com>2020-06-13 06:59:19 +0800
commit44863b2c2d5a31d82aafa71cdbd180d6bfbed5b4 (patch)
treec11e6f716b2737138c414c5d780b5a2645865d50 /libavcodec/iirfilter.c
parentebf2a8abdfd7d314e63528773de210bff90e86e3 (diff)
downloadffmpeg-44863b2c2d5a31d82aafa71cdbd180d6bfbed5b4.tar.gz
avcodec/iirfilter: remove FF_ALLOCZ_OR_GOTO and gotos label
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Diffstat (limited to 'libavcodec/iirfilter.c')
-rw-r--r--libavcodec/iirfilter.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/libavcodec/iirfilter.c b/libavcodec/iirfilter.c
index 749fa5757f..9f76bce8b8 100644
--- a/libavcodec/iirfilter.c
+++ b/libavcodec/iirfilter.c
@@ -171,12 +171,10 @@ av_cold struct FFIIRFilterCoeffs *ff_iir_filter_init_coeffs(void *avc,
if (order <= 0 || order > MAXORDER || cutoff_ratio >= 1.0)
return NULL;
- FF_ALLOCZ_OR_GOTO(avc, c, sizeof(FFIIRFilterCoeffs),
- init_fail);
- FF_ALLOC_OR_GOTO(avc, c->cx, sizeof(c->cx[0]) * ((order >> 1) + 1),
- init_fail);
- FF_ALLOC_OR_GOTO(avc, c->cy, sizeof(c->cy[0]) * order,
- init_fail);
+ if (!(c = av_mallocz(sizeof(*c))) ||
+ !(c->cx = av_malloc (sizeof(c->cx[0]) * ((order >> 1) + 1))) ||
+ !(c->cy = av_malloc (sizeof(c->cy[0]) * order)))
+ return NULL;
c->order = order;
switch (filt_type) {
@@ -190,13 +188,11 @@ av_cold struct FFIIRFilterCoeffs *ff_iir_filter_init_coeffs(void *avc,
break;
default:
av_log(avc, AV_LOG_ERROR, "filter type is not currently implemented\n");
- goto init_fail;
+ return NULL;
}
if (!ret)
return c;
-
-init_fail:
return NULL;
}