[vlc-commits] Fix VLC_CLIP usage (and potential divisions by zero)

Rémi Duraffort git at videolan.org
Thu Aug 29 14:19:22 CEST 2013


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Wed Aug 28 20:15:14 2013 +0200| [a948f09671f15b9e84c19d14b91f3ee0aa0eee91] | committer: Jean-Baptiste Kempf

Fix VLC_CLIP usage (and potential divisions by zero)

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/video_splitter/panoramix.c |    4 ++--
 modules/video_splitter/wall.c      |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/modules/video_splitter/panoramix.c b/modules/video_splitter/panoramix.c
index e876942..9de7efa 100644
--- a/modules/video_splitter/panoramix.c
+++ b/modules/video_splitter/panoramix.c
@@ -501,8 +501,8 @@ static int Open( vlc_object_t *p_this )
     p_sys->a_0 =  p_sys->bz_begin;
 
     /* */
-    p_sys->i_col = VLC_CLIP( COL_MAX, 1, p_sys->i_col );
-    p_sys->i_row = VLC_CLIP( ROW_MAX, 1, p_sys->i_row );
+    p_sys->i_col = VLC_CLIP( p_sys->i_col, 1, COL_MAX );
+    p_sys->i_row = VLC_CLIP( p_sys->i_row, 1, ROW_MAX );
     msg_Dbg( p_splitter, "opening a %i x %i wall",
              p_sys->i_col, p_sys->i_row );
 
diff --git a/modules/video_splitter/wall.c b/modules/video_splitter/wall.c
index 24e9384..5be60dc 100644
--- a/modules/video_splitter/wall.c
+++ b/modules/video_splitter/wall.c
@@ -137,10 +137,10 @@ static int Open( vlc_object_t *p_this )
 
     /* */
     p_sys->i_col = var_CreateGetInteger( p_splitter, CFG_PREFIX "cols" );
-    p_sys->i_col = VLC_CLIP( COL_MAX, 1, p_sys->i_col );
+    p_sys->i_col = VLC_CLIP( p_sys->i_col, 1, COL_MAX );
 
     p_sys->i_row = var_CreateGetInteger( p_splitter, CFG_PREFIX "rows" );
-    p_sys->i_row = VLC_CLIP( ROW_MAX, 1, p_sys->i_row );
+    p_sys->i_row = VLC_CLIP( p_sys->i_row, 1, ROW_MAX );
 
     msg_Dbg( p_splitter, "opening a %i x %i wall",
              p_sys->i_col, p_sys->i_row );



More information about the vlc-commits mailing list