[FFmpeg-cvslog] lavfi/ocv: fix crash with no filter name specified.

Clément Bœsch git at videolan.org
Fri Apr 12 12:44:29 CEST 2013


ffmpeg | branch: master | Clément Bœsch <ubitux at gmail.com> | Fri Apr 12 12:44:23 2013 +0200| [490786c02e8551ab9e7c23d6025a775a6e6a64cc] | committer: Clément Bœsch

lavfi/ocv: fix crash with no filter name specified.

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

 libavfilter/vf_libopencv.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavfilter/vf_libopencv.c b/libavfilter/vf_libopencv.c
index cbaf8f7..b27f30d 100644
--- a/libavfilter/vf_libopencv.c
+++ b/libavfilter/vf_libopencv.c
@@ -322,6 +322,10 @@ static av_cold int init(AVFilterContext *ctx)
     OCVContext *ocv = ctx->priv;
     int i;
 
+    if (!ocv->name) {
+        av_log(ctx, AV_LOG_ERROR, "No libopencv filter name specified\n");
+        return AVERROR(EINVAL);
+    }
     for (i = 0; i < FF_ARRAY_ELEMS(ocv_filter_entries); i++) {
         OCVFilterEntry *entry = &ocv_filter_entries[i];
         if (!strcmp(ocv->name, entry->name)) {



More information about the ffmpeg-cvslog mailing list