[FFmpeg-cvslog] avfilter/af_adelay: do not crash if allocation of chandelay failed

Paul B Mahol git at videolan.org
Thu Oct 18 11:24:28 EEST 2018


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Thu Oct 18 10:21:09 2018 +0200| [bf5bdbdb926742235e2037389115e9308223e153] | committer: Paul B Mahol

avfilter/af_adelay: do not crash if allocation of chandelay failed

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

 libavfilter/af_adelay.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/libavfilter/af_adelay.c b/libavfilter/af_adelay.c
index d6d81ba7d8..46c3d51040 100644
--- a/libavfilter/af_adelay.c
+++ b/libavfilter/af_adelay.c
@@ -249,10 +249,11 @@ static int request_frame(AVFilterLink *outlink)
 static av_cold void uninit(AVFilterContext *ctx)
 {
     AudioDelayContext *s = ctx->priv;
-    int i;
 
-    for (i = 0; i < s->nb_delays; i++)
-        av_freep(&s->chandelay[i].samples);
+    if (s->chandelay) {
+        for (int i = 0; i < s->nb_delays; i++)
+            av_freep(&s->chandelay[i].samples);
+    }
     av_freep(&s->chandelay);
 }
 



More information about the ffmpeg-cvslog mailing list