[FFmpeg-cvslog] lavfi: check av_strdup() return value

Paul B Mahol git at videolan.org
Tue Jan 20 03:36:12 CET 2015


ffmpeg | branch: release/2.2 | Paul B Mahol <onemda at gmail.com> | Tue Jan  6 09:42:59 2015 +0000| [bebe3d35f3620cae6aeb83f8cd795cc8dce5f0e4] | committer: Michael Niedermayer

lavfi: check av_strdup() return value

Signed-off-by: Paul B Mahol <onemda at gmail.com>
(cherry picked from commit 145a84717b62e086cdb5f26649ad9f1b51ef38d0)

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavfilter/af_amix.c   |    2 ++
 libavfilter/af_join.c   |    2 ++
 libavfilter/split.c     |    2 ++
 libavfilter/src_movie.c |    2 ++
 4 files changed, 8 insertions(+)

diff --git a/libavfilter/af_amix.c b/libavfilter/af_amix.c
index 7140b6c..4d5177f 100644
--- a/libavfilter/af_amix.c
+++ b/libavfilter/af_amix.c
@@ -496,6 +496,8 @@ static av_cold int init(AVFilterContext *ctx)
         snprintf(name, sizeof(name), "input%d", i);
         pad.type           = AVMEDIA_TYPE_AUDIO;
         pad.name           = av_strdup(name);
+        if (!pad.name)
+            return AVERROR(ENOMEM);
         pad.filter_frame   = filter_frame;
 
         ff_insert_inpad(ctx, i, &pad);
diff --git a/libavfilter/af_join.c b/libavfilter/af_join.c
index 3e9ccc8..7d99a4c 100644
--- a/libavfilter/af_join.c
+++ b/libavfilter/af_join.c
@@ -214,6 +214,8 @@ static av_cold int join_init(AVFilterContext *ctx)
         snprintf(name, sizeof(name), "input%d", i);
         pad.type           = AVMEDIA_TYPE_AUDIO;
         pad.name           = av_strdup(name);
+        if (!pad.name)
+            return AVERROR(ENOMEM);
         pad.filter_frame   = filter_frame;
 
         pad.needs_fifo = 1;
diff --git a/libavfilter/split.c b/libavfilter/split.c
index 6abd5ee..7353810 100644
--- a/libavfilter/split.c
+++ b/libavfilter/split.c
@@ -52,6 +52,8 @@ static av_cold int split_init(AVFilterContext *ctx)
         snprintf(name, sizeof(name), "output%d", i);
         pad.type = ctx->filter->inputs[0].type;
         pad.name = av_strdup(name);
+        if (!pad.name)
+            return AVERROR(ENOMEM);
 
         ff_insert_outpad(ctx, i, &pad);
     }
diff --git a/libavfilter/src_movie.c b/libavfilter/src_movie.c
index a1bb843..4a0a951 100644
--- a/libavfilter/src_movie.c
+++ b/libavfilter/src_movie.c
@@ -292,6 +292,8 @@ static av_cold int movie_common_init(AVFilterContext *ctx)
         snprintf(name, sizeof(name), "out%d", i);
         pad.type          = movie->st[i].st->codec->codec_type;
         pad.name          = av_strdup(name);
+        if (!pad.name)
+            return AVERROR(ENOMEM);
         pad.config_props  = movie_config_output_props;
         pad.request_frame = movie_request_frame;
         ff_insert_outpad(ctx, i, &pad);



More information about the ffmpeg-cvslog mailing list