for( i = 0; ppsz_path[i]; i++ )
{
/* Old format */
- asprintf( &psz_dll, "%s/%4.4s.so.6.0", ppsz_path[i],
- (char *)&p_dec->fmt_in.i_codec );
- i_result = OpenNativeDll( p_dec, ppsz_path[i], psz_dll );
- free( psz_dll );
- if( i_result == VLC_SUCCESS ) return VLC_SUCCESS;
+ if( asprintf( &psz_dll, "%s/%4.4s.so.6.0", ppsz_path[i],
+ (char *)&p_dec->fmt_in.i_codec ) != -1 )
+ {
+ i_result = OpenNativeDll( p_dec, ppsz_path[i], psz_dll );
+ free( psz_dll );
+ if( i_result == VLC_SUCCESS ) return VLC_SUCCESS;
+ }
/* New format */
- asprintf( &psz_dll, "%s/%4.4s.so", ppsz_path[i],
- (char *)&p_dec->fmt_in.i_codec );
- i_result = OpenNativeDll( p_dec, ppsz_path[i], psz_dll );
- free( psz_dll );
- if( i_result == VLC_SUCCESS ) return VLC_SUCCESS;
-
+ if( asprintf( &psz_dll, "%s/%4.4s.so", ppsz_path[i],
+ (char *)&p_dec->fmt_in.i_codec ) != -1 )
+ {
+ i_result = OpenNativeDll( p_dec, ppsz_path[i], psz_dll );
+ free( psz_dll );
+ if( i_result == VLC_SUCCESS ) return VLC_SUCCESS;
+ }
}
#endif
for( i = 0; ppsz_path[i]; i++ )
{
/* New format */
- asprintf( &psz_dll, "%s\\%4.4s.dll", ppsz_path[i],
- (char *)&p_dec->fmt_in.i_codec );
- i_result = OpenWin32Dll( p_dec, ppsz_path[i], psz_dll );
- free( psz_dll );
- if( i_result == VLC_SUCCESS ) return VLC_SUCCESS;
+ if( asprintf( &psz_dll, "%s\\%4.4s.dll", ppsz_path[i],
+ (char *)&p_dec->fmt_in.i_codec ) != -1 )
+ {
+ i_result = OpenWin32Dll( p_dec, ppsz_path[i], psz_dll );
+ free( psz_dll );
+ if( i_result == VLC_SUCCESS ) return VLC_SUCCESS;
+ }
/* Old format */
- asprintf( &psz_dll, "%s\\%4.4s3260.dll", ppsz_path[i],
- (char *)&p_dec->fmt_in.i_codec );
- i_result = OpenWin32Dll( p_dec, ppsz_path[i], psz_dll );
- free( psz_dll );
- if( i_result == VLC_SUCCESS ) return VLC_SUCCESS;
+ if( asprintf( &psz_dll, "%s\\%4.4s3260.dll", ppsz_path[i],
+ (char *)&p_dec->fmt_in.i_codec ) != -1 )
+ {
+ i_result = OpenWin32Dll( p_dec, ppsz_path[i], psz_dll );
+ free( psz_dll );
+ if( i_result == VLC_SUCCESS ) return VLC_SUCCESS;
+ }
}
#endif
if( b_index && ( p = strstr( f->file, "index." ) ) )
{
- asprintf( &psz_redir, "%s%s", f->name, p );
-
- msg_Dbg( p_intf, "redir=%s -> %s", psz_redir, f->name );
- f->p_redir2 = httpd_RedirectNew( p_sys->p_httpd_host,
- f->name, psz_redir );
+ if( asprintf( &psz_redir, "%s%s", f->name, p ) != -1 )
+ {
+ msg_Dbg( p_intf, "redir=%s -> %s", psz_redir, f->name );
+ f->p_redir2 = httpd_RedirectNew( p_sys->p_httpd_host,
+ f->name, psz_redir );
- free( psz_redir );
+ free( psz_redir );
+ }
}
}
}
else if( i_type == 3 )
{
/* DWord */
- asprintf( &p_ec->ppsz_value[i], "%d", ASF_READ4() );
+ if( asprintf( &p_ec->ppsz_value[i], "%d", ASF_READ4() ) == -1 )
+ p_ec->ppsz_value[i] = NULL;
}
else if( i_type == 4 )
{
/* QWord */
- asprintf( &p_ec->ppsz_value[i], "%"PRId64, ASF_READ8() );
+ if( asprintf( &p_ec->ppsz_value[i], "%"PRId64, ASF_READ8() ) == -1 )
+ p_ec->ppsz_value[i] = NULL;
}
else if( i_type == 5 )
{
/* Word */
- asprintf( &p_ec->ppsz_value[i], "%d", ASF_READ2() );
+ if( asprintf( &p_ec->ppsz_value[i], "%d", ASF_READ2() ) == -1 )
+ p_ec->ppsz_value[i] = NULL;
}
else
{