]> git.sesse.net Git - vlc/commitdiff
Fix another realloc() that can easily be fixed. The other one in the file
authorJP Dinger <jpd@videolan.org>
Fri, 24 Jul 2009 11:36:51 +0000 (13:36 +0200)
committerJP Dinger <jpd@videolan.org>
Fri, 24 Jul 2009 11:36:51 +0000 (13:36 +0200)
I don't immediately see a solution for.

modules/demux/playlist/asx.c

index 12cd294e23696c7421f14bbcb129b9ddbf943d1e..56e9f07166b7eee772b2a3914fe8f1aa00b4e554 100644 (file)
@@ -89,7 +89,9 @@ static int StoreString( demux_t *p_demux, char **ppsz_string,
         }
         *buf++ = '\0';
 
-        buf = *ppsz_string = realloc (*ppsz_string, buf - *ppsz_string);
+        buf = realloc (*ppsz_string, buf - *ppsz_string);
+        if( buf )
+            *ppsz_string = buf;
     }
     return VLC_SUCCESS;
 }
@@ -250,6 +252,7 @@ static int Demux( demux_t *p_demux )
 
             if( i_read < p_sys->i_data_len - i_pos ) break; /* Done */
 
+            /* XXX this looks fishy and inefficient */
             i_pos += i_read;
             p_sys->i_data_len += 1024;
             p_sys->psz_data = realloc( p_sys->psz_data, p_sys->i_data_len * sizeof( char * ) +1 );