Skip to content
Snippets Groups Projects
Commit 09b523a4 authored by François Cartegnie's avatar François Cartegnie :fingers_crossed: Committed by Hugo Beauzée-Luyssen
Browse files

demux: ogg: add lookup limit for chained streams

parent 66e6c1e3
No related branches found
No related tags found
1 merge request!1275demux: ogg: add lookup limit for chained streams
Pipeline #183416 passed with stage
in 23 minutes and 39 seconds
......@@ -383,6 +383,10 @@ static int64_t find_first_page_granule( demux_t *p_demux,
seek_byte( p_demux, p_sys->i_input_position );
ogg_stream_reset( &p_stream->os );
/* prevent reading the whole file if stream is gone */
if( i_pos2 > p_sys->i_input_position + OGGSEEK_SERIALNO_MAX_LOOKUP_BYTES )
i_pos2 = p_sys->i_input_position + OGGSEEK_SERIALNO_MAX_LOOKUP_BYTES;
while( 1 )
{
......
......@@ -38,6 +38,7 @@
#define PAGE_HEADER_BYTES 27
#define OGGSEEK_BYTES_TO_READ 8500
#define OGGSEEK_SERIALNO_MAX_LOOKUP_BYTES (OGGSEEK_BYTES_TO_READ * 25)
/* index entries are structured as follows:
* - for theora, highest granulepos -> pagepos (bytes) where keyframe begins
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment