Commit cc6941a5 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Fix memory leak and error handling

parent 8cb6c0e6
...@@ -274,26 +274,31 @@ static int InitVideo(decoder_t *p_dec) ...@@ -274,26 +274,31 @@ static int InitVideo(decoder_t *p_dec)
"\0" "\0"
}; };
for( size_t i = 0; psz_paths[i]; i += strlen( psz_paths[i] ) + 1 ) for( size_t i = 0; psz_paths[i]; i += strlen( psz_paths + i ) + 1 )
{ {
asprintf( &g_decode_path, "%s/drv4.so.6.0", psz_paths + i ); if( asprintf( &g_decode_path, "%s/drv4.so.6.0", psz_paths + i ) != -1 )
if( (p_sys->rv_handle = load_syms_linux(p_dec, g_decode_path)) )
{ {
b_so_opened = true; p_sys->rv_handle = load_syms_linux(p_dec, g_decode_path);
free( g_decode_path ); free( g_decode_path );
}
if( p_sys->rv_handle )
{
b_so_opened = true;
break; break;
} }
asprintf( &g_decode_path, "%s/drv3.so.6.0", psz_paths + i ); if( asprintf( &g_decode_path, "%s/drv3.so.6.0", psz_paths + i ) != -1 )
if( (p_sys->rv_handle = load_syms_linux(p_dec, g_decode_path)) )
{ {
b_so_opened = true; p_sys->rv_handle = load_syms_linux(p_dec, g_decode_path);
free( g_decode_path ); free( g_decode_path );
}
if( p_sys->rv_handle )
{
b_so_opened = true;
break; break;
} }
msg_Dbg( p_dec, "Cannot load real decoder library: %s", g_decode_path); msg_Dbg( p_dec, "Cannot load real decoder library: %s", g_decode_path);
free( g_decode_path );
} }
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment