[vlc-commits] [Git][videolan/vlc][master] demux: ogg: add lookup limit for chained streams
Hugo Beauzée-Luyssen (@chouquette)
gitlab at videolan.org
Tue Jan 25 09:42:51 UTC 2022
Hugo Beauzée-Luyssen pushed to branch master at VideoLAN / VLC
Commits:
09b523a4 by Francois Cartegnie at 2022-01-25T08:47:37+00:00
demux: ogg: add lookup limit for chained streams
- - - - -
2 changed files:
- modules/demux/oggseek.c
- modules/demux/oggseek.h
Changes:
=====================================
modules/demux/oggseek.c
=====================================
@@ -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 )
{
=====================================
modules/demux/oggseek.h
=====================================
@@ -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
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/09b523a4eb9d608735b7152d6d8ced26d9a33f1d
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/09b523a4eb9d608735b7152d6d8ced26d9a33f1d
You're receiving this email because of your account on code.videolan.org.
More information about the vlc-commits
mailing list