Prevents crash when arturl is misformatted, and can't be translated to a filename
authorRafaël Carré <funman@videolan.org>
Tue, 21 Aug 2007 13:20:01 +0000 (13:20 +0000)
committerRafaël Carré <funman@videolan.org>
Tue, 21 Aug 2007 13:20:01 +0000 (13:20 +0000)
src/input/meta.c

index 3081b7e..ebf07ca 100644 (file)
@@ -416,6 +416,11 @@ int input_DownloadAndCacheArt( playlist_t *p_playlist, input_item_t *p_item )
         uint8_t p_buffer[65536];
         long int l_read;
         FILE *p_file = utf8_fopen( psz_filename+7, "w" );
+        if( p_file == NULL ) {
+            msg_Err( p_playlist, "Unable write album art in %s" );
+            free( psz_arturl_m );
+            return VLC_EGENERIC;
+        }
         int err = 0;
         while( ( l_read = stream_Read( p_stream, p_buffer, sizeof (p_buffer) ) ) )
         {