[vlc-devel] [PATCH 2/4] input: InputGetExtraFilesPattern: include scheme in concat-list entries

Filip Roséen filip at atch.se
Thu May 25 22:08:58 CEST 2017


Dear Filip,

 - Review your patches _before_ sending to `vlc-devel`, not after.
 - ...
 - Yes, I know you cannot smoke in front of your computer.
 - ...
 - Aw come on, you can definitely have a smoke before sending, instead
   of after.
 - ...
 - No, I do not care that the coffee is too hot to drink and that
   you'd like a cup while smoking.

On 2017-05-25 21:58, Filip Roséen wrote:

> This allows for easier implementation for modules using the
> concat-list, as it can assume that all entries can be passed directly
> to functions such as vlc_stream_NewURL (as they are now valid URIs).
> 
> These changes also makes it so that the contents of concat-list
> matches that of the documentation, as it uses the notion "input URLs".
> ---
>  src/input/input.c | 27 +++++++++++++++------------
>  1 file changed, 15 insertions(+), 12 deletions(-)
> 
> diff --git a/src/input/input.c b/src/input/input.c
> index f68bc7e631..479dd50238 100644
> --- a/src/input/input.c
> +++ b/src/input/input.c
> @@ -2845,7 +2845,6 @@ static void InputGetExtraFilesPattern( input_thread_t *p_input,
>  {
>      int i_list;
>      char **ppsz_list;
> -
>      TAB_INIT( i_list, ppsz_list );
>  
>      char *psz_base = strdup( psz_path );
> @@ -2860,24 +2859,28 @@ static void InputGetExtraFilesPattern( input_thread_t *p_input,
>      /* Try to list files */
>      for( int i = i_start; i <= i_stop; i++ )
>      {
> -        struct stat st;
> -        char *psz_file;
> -
> -        if( asprintf( &psz_file, psz_format, psz_base, i ) < 0 )
> +        char *psz_probe;
> +        if( asprintf( &psz_probe, psz_format, psz_base, i ) < 0 )
>              break;
>  
> -        char *psz_tmp_path = get_path( psz_file );
> +        char *psz_path = get_path( psz_probe );

Right when I sent this email I noticed that I did not fix a previous,
potential, null-dereference (on the line above) as part of the
refactoring.. bloody shameful.

Attached is the equivalent patch where this is taken care of.

Best Regards,\
Filip
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20170525/4a7e14c2/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-input-InputGetExtraFilesPattern-include-scheme-in-co.patch
Type: text/x-diff
Size: 2410 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20170525/4a7e14c2/attachment.patch>


More information about the vlc-devel mailing list