]> git.sesse.net Git - vlc/blobdiff - src/playlist/fetcher.c
Introduce realloc_or_free() to src/*, and add assert() to mark unhandled ENOMEM error...
[vlc] / src / playlist / fetcher.c
index 4a83ed5bb48175e0e8cfde5d805c3f992fce0d89..eaecfd06adb645c228fae58df3d687e31d09e487 100644 (file)
 # include "config.h"
 #endif
 
+#include <assert.h>
+
 #include <vlc_common.h>
 #include <vlc_playlist.h>
 #include <vlc_stream.h>
 #include <limits.h>
 #include <vlc_art_finder.h>
+#include <vlc_memory.h>
 
 #include "art.h"
 #include "fetcher.h"
 #include "playlist_internal.h"
 
-
 /*****************************************************************************
  * Structures/definitions
  *****************************************************************************/
@@ -291,7 +293,7 @@ static int DownloadArt( playlist_fetcher_t *p_fetcher, input_item_t *p_item )
         if( i_data >= INT_MAX - i_read )
             break;
 
-        p_data = realloc( p_data, i_data + i_read );
+        p_data = realloc_or_free( p_data, i_data + i_read );
         if( !p_data )
             break;