[FFmpeg-devel] [PATCH 7/9] Add missing memory check in parse_inputs(), and fix possible (yet very unlikely) crash.

Stefano Sabatini stefano.sabatini-lala
Fri Nov 5 18:20:31 CET 2010


---
 libavfilter/graphparser.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/libavfilter/graphparser.c b/libavfilter/graphparser.c
index a19e1d0..1038e12 100644
--- a/libavfilter/graphparser.c
+++ b/libavfilter/graphparser.c
@@ -262,7 +262,8 @@ static int parse_inputs(const char **buf, AVFilterInOut **curr_inputs,
             av_free(name);
         } else {
             /* Not in the list, so add it as an input */
-            match = av_mallocz(sizeof(AVFilterInOut));
+            if (!(match = av_mallocz(sizeof(AVFilterInOut))))
+                return AVERROR(ENOMEM);
             match->name    = name;
             match->pad_idx = pad;
         }
-- 
1.7.1




More information about the ffmpeg-devel mailing list