Commit 0e1ae34c authored by Michael Tänzer's avatar Michael Tänzer Committed by Jean-Baptiste Kempf

demux: ogg: Fix creating index entries before the first existing entry

Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 415d10cd
...@@ -100,12 +100,11 @@ const demux_index_entry_t *OggSeek_IndexAdd ( logical_stream_t *p_stream, ...@@ -100,12 +100,11 @@ const demux_index_entry_t *OggSeek_IndexAdd ( logical_stream_t *p_stream,
int64_t i_pagepos ) int64_t i_pagepos )
{ {
demux_index_entry_t *idx; demux_index_entry_t *idx;
demux_index_entry_t *oidx;
demux_index_entry_t *last_idx = NULL; demux_index_entry_t *last_idx = NULL;
if ( p_stream == NULL ) return NULL; if ( p_stream == NULL ) return NULL;
oidx = idx = p_stream->idx; idx = p_stream->idx;
if ( i_timestamp < 1 || i_pagepos < 1 ) return NULL; if ( i_timestamp < 1 || i_pagepos < 1 ) return NULL;
...@@ -137,8 +136,8 @@ const demux_index_entry_t *OggSeek_IndexAdd ( logical_stream_t *p_stream, ...@@ -137,8 +136,8 @@ const demux_index_entry_t *OggSeek_IndexAdd ( logical_stream_t *p_stream,
} }
else else
{ {
idx->p_next = oidx; idx->p_next = p_stream->idx;
oidx = idx; p_stream->idx = idx;
} }
if ( idx->p_next != NULL ) if ( idx->p_next != NULL )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment