]> git.sesse.net Git - vlc/commitdiff
puzzle: fix error check, do not leak pictures on error
authorDavid Fuhrmann <dfuhrmann@videolan.org>
Sun, 22 Mar 2015 18:02:28 +0000 (19:02 +0100)
committerDavid Fuhrmann <dfuhrmann@videolan.org>
Sun, 22 Mar 2015 18:06:18 +0000 (19:06 +0100)
close #14006

modules/video_filter/puzzle.c

index 2fe5e0c8afe025f38acda864c16782276c83b7e5..6c6433bbeea541dfe0b7e4292a96195491acd78e 100644 (file)
@@ -289,9 +289,12 @@ picture_t *Filter( filter_t *p_filter, picture_t *p_pic_in ) {
     /* assert no mismatch between sizes */
     if (    p_sys->s_current_param.i_pict_width  != p_sys->s_current_param.i_desk_width
          || p_sys->s_current_param.i_pict_height != p_sys->s_current_param.i_desk_height
-         || p_sys->s_current_param.i_pict_width  != (int) p_fmt_in->i_width
-         || p_sys->s_current_param.i_pict_height != (int) p_fmt_in->i_height )
+         || p_sys->s_current_param.i_pict_width  != (int) p_fmt_in->i_visible_width
+         || p_sys->s_current_param.i_pict_height != (int) p_fmt_in->i_visible_height ) {
+        picture_Release(p_pic_in);
+        picture_Release(p_pic_out);
         return NULL;
+    }
 
     vlc_mutex_lock( &p_sys->lock );