[vlc-devel] commit: podcast: implement "live" podcast item removal (Jakob Leben )

Rémi Duraffort ivoire at videolan.org
Mon Nov 2 15:43:52 CET 2009


> @@ -193,8 +200,7 @@ static void *Run( void *data )
>          int canc = vlc_savecancel ();
>          msg_Dbg( p_sd, "Update required" );
>          char* psz_urls = var_GetNonEmptyString( p_sd, "podcast-urls" );
> -        if( psz_urls != NULL )
> -            ParseUrls( p_sd, psz_urls );
> +        ParseUrls( p_sd, psz_urls );
>          free( psz_urls );
>          p_sys->b_update = false;
If the variable "podcast-urls" is "" (an empty but non-null string) the
return value of var_GetNonEmptyString will be NULL => segv.
In this case, the best way is to do:

char psz_urls = var_GetString( p_sd, "podcast-urls" );
if( psz_urls )
    ParseUrls( p_sd, psz_urls );
free( psz_urls );


Moreover, I now get a crash when launching the podcast SD:

(gdb) bt
#0  0xb7faa424 in __kernel_vsyscall ()
#1  0xb7c5c640 in raise () from /lib/i686/cmov/libc.so.6
#2  0xb7c5e018 in abort () from /lib/i686/cmov/libc.so.6
#3  0xb6263994 in ParseUrls (p_sd=0x9af75ec, psz_urls=0x9aee888
"http://radiofrance-podcast.net/podcast09/rss_14864.xml")
    at ../../../modules/services_discovery/podcast.c:266
#4  0xb6263632 in Run (data=0x9af75ec) at
../../../modules/services_discovery/podcast.c:203
#5  0xb7dbd4c0 in start_thread () from /lib/i686/cmov/libpthread.so.0
#6  0xb7d116de in clone () from /lib/i686/cmov/libc.so.6

(gdb) list
261             for( i = 0; i < p_sys->i_urls; i++ )
262                 if( !strcmp( psz_urls, p_sys->ppsz_urls[i] ) )
263                     break;
264             if( i == p_sys->i_urls )
265             {
266                 INSERT_ELEM( ppsz_new_urls, i_new_urls, i_new_urls,
267                              strdup( psz_urls ) );
268
269                 input_item_t *p_input;
270                 p_input = input_item_New( p_sd, psz_urls, psz_urls )
266                 INSERT_ELEM( ppsz_new_urls, i_new_urls, i_new_urls,

(gdb) p ppsz_new_urls 
$1 = (char **) 0x0


Best regards

-- 
Rémi Duraffort | ivoire



More information about the vlc-devel mailing list