[FFmpeg-cvslog] avfilter/af_mcompand: check allocation results

Marton Balint git at videolan.org
Mon Apr 19 00:02:32 EEST 2021


ffmpeg | branch: master | Marton Balint <cus at passwd.hu> | Sat Apr 10 12:03:17 2021 +0200| [46f3ae8f672533a380dea7c4e13c84d52014de6c] | committer: Marton Balint

avfilter/af_mcompand: check allocation results

Fixes the only remaining part of ticket #8931.

Signed-off-by: Marton Balint <cus at passwd.hu>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=46f3ae8f672533a380dea7c4e13c84d52014de6c
---

 libavfilter/af_mcompand.c | 3 +++
 1 file changed, 3 insertions(+)

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);
 



More information about the ffmpeg-cvslog mailing list