summaryrefslogtreecommitdiff
path: root/libavfilter
diff options
context:
space:
mode:
authorMarton Balint <cus@passwd.hu>2021-04-10 12:03:17 +0200
committerMarton Balint <cus@passwd.hu>2021-04-18 17:25:51 +0200
commit46f3ae8f672533a380dea7c4e13c84d52014de6c (patch)
tree1e8564ca26f96d521797a973068a80ebdc4cf41f /libavfilter
parent28c83584e8f3cd747c1476a74cc2841d3d1fa7f3 (diff)
avfilter/af_mcompand: check allocation results
Fixes the only remaining part of ticket #8931. Signed-off-by: Marton Balint <cus@passwd.hu>
Diffstat (limited to 'libavfilter')
-rw-r--r--libavfilter/af_mcompand.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavfilter/af_mcompand.c b/libavfilter/af_mcompand.c
index ce4f366ad7..d1a3dc123a 100644
--- a/libavfilter/af_mcompand.c
+++ b/libavfilter/af_mcompand.c
@@ -384,6 +384,9 @@ static int config_output(AVFilterLink *outlink)
s->bands[i].attack_rate = av_calloc(outlink->channels, sizeof(double));
s->bands[i].decay_rate = av_calloc(outlink->channels, sizeof(double));
s->bands[i].volume = av_calloc(outlink->channels, sizeof(double));
+ if (!s->bands[i].attack_rate || !s->bands[i].decay_rate || !s->bands[i].volume)
+ return AVERROR(ENOMEM);
+
for (k = 0; k < FFMIN(nb_attacks / 2, outlink->channels); k++) {
char *tstr3 = av_strtok(p3, ",", &saveptr3);