ci_filters: fix null-deref
authorThomas Guillem <thomas@gllm.fr>
Thu, 9 Aug 2018 09:54:34 +0000 (11:54 +0200)
committerThomas Guillem <thomas@gllm.fr>
Thu, 9 Aug 2018 11:29:13 +0000 (13:29 +0200)
regression from 4c8b741e4844a80fb824caccd9606259d5958aa0

modules/video_filter/ci_filters.m

index 2b92821..09e758c 100644 (file)
@@ -587,7 +587,6 @@ static int
 Open(vlc_object_t *obj, char const *psz_filter)
 {
     filter_t *filter = (filter_t *)obj;
-    filter_sys_t *p_sys = filter->p_sys;
 
     switch (filter->fmt_in.video.i_chroma)
     {
@@ -605,7 +604,7 @@ Open(vlc_object_t *obj, char const *psz_filter)
             return VLC_EGENERIC;
     }
 
-    filter->p_sys = calloc(1, sizeof(filter_sys_t));
+    filter_sys_t *p_sys = filter->p_sys = calloc(1, sizeof(filter_sys_t));
     if (!filter->p_sys)
         return VLC_ENOMEM;