[vlc-commits] puzzle: fix error check, do not leak pictures on error

David Fuhrmann git at videolan.org
Sun Mar 22 19:06:24 CET 2015


vlc | branch: master | David Fuhrmann <dfuhrmann at videolan.org> | Sun Mar 22 19:02:28 2015 +0100| [5c2fc028e78429b8a9d540c7fa9d227c5efa0620] | committer: David Fuhrmann

puzzle: fix error check, do not leak pictures on error

close #14006

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=5c2fc028e78429b8a9d540c7fa9d227c5efa0620
---

 modules/video_filter/puzzle.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/modules/video_filter/puzzle.c b/modules/video_filter/puzzle.c
index 2fe5e0c..6c6433b 100644
--- a/modules/video_filter/puzzle.c
+++ b/modules/video_filter/puzzle.c
@@ -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 );
 



More information about the vlc-commits mailing list