mirror of
https://github.com/mpv-player/mpv
synced 2025-02-28 11:20:56 +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:
parent
fd9fe9e04d
commit
c5563969ec
@ -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;
|
priv->index_malloc_size[stream_id] = 2048;
|
||||||
else
|
else
|
||||||
priv->index_malloc_size[stream_id] += priv->index_malloc_size[stream_id] / 2;
|
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]));
|
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)
|
if (priv->index_table_size[stream_id] > 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user