1
0
mirror of https://github.com/mpv-player/mpv synced 2025-02-28 03:10:55 +00:00

Fix rm files with a really big index chunk.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@14898 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
reimar 2005-03-03 10:23:28 +00:00
parent fd9fe9e04d
commit c5563969ec

View File

@ -245,6 +245,11 @@ static void add_index_item(demuxer_t *demuxer, int stream_id, int timestamp, int
priv->index_malloc_size[stream_id] = 2048;
else
priv->index_malloc_size[stream_id] += priv->index_malloc_size[stream_id] / 2;
// in case we have a really large chunk...
if (priv->index_table_size[stream_id] >=
priv->index_malloc_size[stream_id])
priv->index_malloc_size[stream_id] =
priv->index_table_size[stream_id] + 1;
priv->index_table[stream_id] = realloc(priv->index_table[stream_id], priv->index_malloc_size[stream_id]*sizeof(priv->index_table[0][0]));
}
if (priv->index_table_size[stream_id] > 0)