[libdvdnav-devel] [PATCH 22/33] Check for positive integer values

Jean-Baptiste Kempf jb at videolan.org
Wed Jan 21 17:30:01 CET 2015


Can you explain why?

On 15 Jan, beandog at gentoo.org wrote :
> From: Steve Dibb <steve.dibb at gmail.com>
> 
> ---
>  src/ifo_read.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/src/ifo_read.c b/src/ifo_read.c
> index 38edbb9..5286340 100644
> --- a/src/ifo_read.c
> +++ b/src/ifo_read.c
> @@ -828,7 +828,7 @@ static int ifoRead_PGC_COMMAND_TBL(ifo_handle_t *ifofile,
>  
>    CHECK_VALUE(cmd_tbl->nr_of_pre + cmd_tbl->nr_of_post + cmd_tbl->nr_of_cell<= 255);
>  
> -  if(cmd_tbl->nr_of_pre != 0) {
> +  if(cmd_tbl->nr_of_pre > 0) {
>      unsigned int pre_cmds_size  = cmd_tbl->nr_of_pre * COMMAND_DATA_SIZE;
>      cmd_tbl->pre_cmds = malloc(pre_cmds_size);
>      if(!cmd_tbl->pre_cmds)
> @@ -841,7 +841,7 @@ static int ifoRead_PGC_COMMAND_TBL(ifo_handle_t *ifofile,
>      }
>    }
>  
> -  if(cmd_tbl->nr_of_post != 0) {
> +  if(cmd_tbl->nr_of_post > 0) {
>      unsigned int post_cmds_size = cmd_tbl->nr_of_post * COMMAND_DATA_SIZE;
>      cmd_tbl->post_cmds = malloc(post_cmds_size);
>      if(!cmd_tbl->post_cmds) {
> @@ -858,7 +858,7 @@ static int ifoRead_PGC_COMMAND_TBL(ifo_handle_t *ifofile,
>      }
>    }
>  
> -  if(cmd_tbl->nr_of_cell != 0) {
> +  if(cmd_tbl->nr_of_cell > 0) {
>      unsigned int cell_cmds_size = cmd_tbl->nr_of_cell * COMMAND_DATA_SIZE;
>      cmd_tbl->cell_cmds = malloc(cell_cmds_size);
>      if(!cmd_tbl->cell_cmds) {
> -- 
> 2.0.4
> 
> _______________________________________________
> libdvdnav-devel mailing list
> libdvdnav-devel at videolan.org
> https://mailman.videolan.org/listinfo/libdvdnav-devel

-- 
With my kindest regards,

-- 
Jean-Baptiste Kempf
http://www.jbkempf.com/ - +33 672 704 734
Sent from my Electronic Device


More information about the libdvdnav-devel mailing list