[FFmpeg-cvslog] avfilter/avf_aphasemeter: check return value of ff_insert_outpad()

Paul B Mahol git at videolan.org
Sat Sep 15 23:00:03 EEST 2018


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Sat Sep 15 21:51:59 2018 +0200| [83f7a5eb62bfb21d06f91bb70ad3cea80a13649a] | committer: Paul B Mahol

avfilter/avf_aphasemeter: check return value of ff_insert_outpad()

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

 libavfilter/avf_aphasemeter.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/libavfilter/avf_aphasemeter.c b/libavfilter/avf_aphasemeter.c
index 8cdee9464c..ed837059ea 100644
--- a/libavfilter/avf_aphasemeter.c
+++ b/libavfilter/avf_aphasemeter.c
@@ -233,6 +233,7 @@ static av_cold int init(AVFilterContext *ctx)
 {
     AudioPhaseMeterContext *s = ctx->priv;
     AVFilterPad pad;
+    int ret;
 
     pad = (AVFilterPad){
         .name         = av_strdup("out0"),
@@ -240,7 +241,11 @@ static av_cold int init(AVFilterContext *ctx)
     };
     if (!pad.name)
         return AVERROR(ENOMEM);
-    ff_insert_outpad(ctx, 0, &pad);
+    ret = ff_insert_outpad(ctx, 0, &pad);
+    if (ret < 0) {
+        av_freep(&pad.name);
+        return ret;
+    }
 
     if (s->do_video) {
         pad = (AVFilterPad){
@@ -250,7 +255,11 @@ static av_cold int init(AVFilterContext *ctx)
         };
         if (!pad.name)
             return AVERROR(ENOMEM);
-        ff_insert_outpad(ctx, 1, &pad);
+        ret = ff_insert_outpad(ctx, 1, &pad);
+        if (ret < 0) {
+            av_freep(&pad.name);
+            return ret;
+        }
     }
 
     return 0;



More information about the ffmpeg-cvslog mailing list