[libdvdnav-devel] [PATCH 3/7] Use correct constant

Jean-Baptiste Kempf jb at videolan.org
Wed May 20 21:13:36 CEST 2015


Applied. Thanks.


Le 20/05/2015 12:41, Petri Hintukainen a écrit :
> TITLES_MAX was used as length of string "/video_ts".
> There's no relation between these two constants.
> ---
>   src/dvd_reader.c | 12 ++++++------
>   1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/src/dvd_reader.c b/src/dvd_reader.c
> index 005d90b..d1b1c04 100644
> --- a/src/dvd_reader.c
> +++ b/src/dvd_reader.c
> @@ -484,16 +484,16 @@ static dvd_reader_t *DVDOpenCommon( const char *ppath,
>       }
>
>   #if defined(_WIN32) || defined(__OS2__)
> -    if(strlen(path_copy) > TITLES_MAX) {
> -      if(!strcasecmp(&(path_copy[strlen( path_copy ) - TITLES_MAX]),
> +    if( strlen( path_copy ) > 9 ) {
> +      if( !strcasecmp( &(path_copy[ strlen( path_copy ) - 9 ]),
>                          "\\video_ts"))
> -        path_copy[strlen(path_copy) - (TITLES_MAX-1)] = '\0';
> +        path_copy[ strlen( path_copy ) - (9-1) ] = '\0';
>       }
>   #endif
> -    if( strlen( path_copy ) > TITLES_MAX ) {
> -      if( !strcasecmp( &(path_copy[ strlen( path_copy ) - TITLES_MAX ]),
> +    if( strlen( path_copy ) > 9 ) {
> +      if( !strcasecmp( &(path_copy[ strlen( path_copy ) - 9 ]),
>                          "/video_ts" ) ) {
> -        path_copy[ strlen( path_copy ) - TITLES_MAX ] = '\0';
> +        path_copy[ strlen( path_copy ) - 9 ] = '\0';
>         }
>       }
>
>


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


More information about the libdvdnav-devel mailing list