]> git.sesse.net Git - vlc/blobdiff - modules/video_filter/psychedelic.c
Useless test before a free()
[vlc] / modules / video_filter / psychedelic.c
index 9a02e2a1a51e656c9cedbca3e84ab37a725a9830..9ea7301346158d7efcf10c998f1a01564cc5b7fa 100644 (file)
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
-#include <string.h>
 
 #include <math.h>                                            /* sin(), cos() */
 
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
 #include <vlc/vlc.h>
 
 #include "vlc_filter.h"
@@ -185,6 +188,8 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
     p_converted = image_Convert( p_filter->p_sys->p_image, p_pic,
                                  &(p_pic->format), &fmt_out );
 
+    if( p_converted )
+    {
 #define copyimage( plane, b ) \
     for( y=0; y<p_converted->p[plane].i_visible_lines; y++) { \
     for( x=0; x<p_converted->p[plane].i_visible_pitch; x++) { \
@@ -205,6 +210,11 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
 #undef copyimage
 
     p_converted->pf_release( p_converted );
+    }
+    else
+    {
+        msg_Err( p_filter, "Image scaling failed miserably." );
+    }
 
     p_filter->p_sys->x += p_filter->p_sys->xinc;
     p_filter->p_sys->y += p_filter->p_sys->yinc;