]> git.sesse.net Git - vlc/blobdiff - modules/codec/realvideo.c
Fix [10fcb9f9c3c73d13340c0bd4153fc4c9c87b7186] (win doesn't have setenv).
[vlc] / modules / codec / realvideo.c
index 3d7f20718983cf29ef8f7e15d7c849f07220f38e..40d0542c72d4b5d9769d3400c7b7a8cd33c97427 100644 (file)
@@ -274,26 +274,31 @@ static int InitVideo(decoder_t *p_dec)
         "\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( (p_sys->rv_handle = load_syms_linux(p_dec, g_decode_path)) )
+        if( asprintf( &g_decode_path, "%s/drv4.so.6.0", psz_paths + i ) != -1 )
         {
-            b_so_opened = true;
+            p_sys->rv_handle = load_syms_linux(p_dec, g_decode_path);
             free( g_decode_path );
+        }
+        if( p_sys->rv_handle )
+        {
+            b_so_opened = true;
             break;
         }
 
-        asprintf( &g_decode_path, "%s/drv3.so.6.0", psz_paths + i );
-        if( (p_sys->rv_handle = load_syms_linux(p_dec, g_decode_path)) )
+        if( asprintf( &g_decode_path, "%s/drv3.so.6.0", psz_paths + i ) != -1 )
         {
-            b_so_opened = true;
+            p_sys->rv_handle = load_syms_linux(p_dec, g_decode_path);
             free( g_decode_path );
+        }
+        if( p_sys->rv_handle )
+        {
+            b_so_opened = true;
             break;
         }
 
         msg_Dbg( p_dec, "Cannot load real decoder library: %s", g_decode_path);
-        free( g_decode_path );
     }
 #endif