summaryrefslogtreecommitdiff
path: root/libavfilter/avfilter.c
diff options
context:
space:
mode:
authorVitor Sessak <vitor1001@gmail.com>2008-02-15 21:39:12 +0000
committerVitor Sessak <vitor1001@gmail.com>2008-02-15 21:39:12 +0000
commit8f618f4c048e3579b62768665c255b89bd99b89f (patch)
tree41662ee752950319f77c9c2baeea55e0c5c23190 /libavfilter/avfilter.c
parent4d7c9be36d48371917fa72c47bc37944884e2ea4 (diff)
Check for error so that
avfilter_open(av_filter_get_by_name(...etc...)) fails gracefully. Commited in SoC by Vitor Sessak on 2007-10-29 16:00:27 Originally committed as revision 12024 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavfilter/avfilter.c')
-rw-r--r--libavfilter/avfilter.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index e017e77ff9..760c01acf3 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -363,7 +363,12 @@ static const char *filter_name(void *p)
AVFilterContext *avfilter_open(AVFilter *filter, char *inst_name)
{
- AVFilterContext *ret = av_malloc(sizeof(AVFilterContext));
+ AVFilterContext *ret;
+
+ if (!filter)
+ return 0;
+
+ ret = av_malloc(sizeof(AVFilterContext));
ret->av_class = av_mallocz(sizeof(AVClass));
ret->av_class->item_name = filter_name;