Commit 92b27c22 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

scene: Fix division by 0

Close #9291
parent 8d0ea8a0
...@@ -30,6 +30,8 @@ ...@@ -30,6 +30,8 @@
# include "config.h" # include "config.h"
#endif #endif
#include <limits.h>
#include <vlc_common.h> #include <vlc_common.h>
#include <vlc_plugin.h> #include <vlc_plugin.h>
#include <vlc_block.h> #include <vlc_block.h>
...@@ -112,8 +114,8 @@ vlc_module_begin () ...@@ -112,8 +114,8 @@ vlc_module_begin ()
REPLACE_TEXT, REPLACE_LONGTEXT, false ) REPLACE_TEXT, REPLACE_LONGTEXT, false )
/* Snapshot method */ /* Snapshot method */
add_integer( CFG_PREFIX "ratio", 50, add_integer_with_range( CFG_PREFIX "ratio", 50, 1, INT_MAX,
RATIO_TEXT, RATIO_LONGTEXT, false ) RATIO_TEXT, RATIO_LONGTEXT, false )
set_callbacks( Create, Destroy ) set_callbacks( Create, Destroy )
vlc_module_end () vlc_module_end ()
...@@ -188,6 +190,8 @@ static int Create( vlc_object_t *p_this ) ...@@ -188,6 +190,8 @@ static int Create( vlc_object_t *p_this )
p_sys->i_width = var_CreateGetInteger( p_this, CFG_PREFIX "width" ); p_sys->i_width = var_CreateGetInteger( p_this, CFG_PREFIX "width" );
p_sys->i_height = var_CreateGetInteger( p_this, CFG_PREFIX "height" ); p_sys->i_height = var_CreateGetInteger( p_this, CFG_PREFIX "height" );
p_sys->i_ratio = var_CreateGetInteger( p_this, CFG_PREFIX "ratio" ); p_sys->i_ratio = var_CreateGetInteger( p_this, CFG_PREFIX "ratio" );
if( p_sys->i_ratio <= 0)
p_sys->i_ratio = 1;
p_sys->b_replace = var_CreateGetBool( p_this, CFG_PREFIX "replace" ); p_sys->b_replace = var_CreateGetBool( p_this, CFG_PREFIX "replace" );
p_sys->psz_prefix = var_CreateGetString( p_this, CFG_PREFIX "prefix" ); p_sys->psz_prefix = var_CreateGetString( p_this, CFG_PREFIX "prefix" );
p_sys->psz_path = var_GetNonEmptyString( p_this, CFG_PREFIX "path" ); p_sys->psz_path = var_GetNonEmptyString( p_this, CFG_PREFIX "path" );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment