[vlc-commits] [Git][videolan/vlc][master] demux: ogg: fix last page probing
François Cartegnie (@fcartegnie)
gitlab at videolan.org
Fri Dec 9 13:19:03 UTC 2022
François Cartegnie pushed to branch master at VideoLAN / VLC
Commits:
efcb930b by Francois Cartegnie at 2022-12-09T13:03:50+00:00
demux: ogg: fix last page probing
properly process the full search window instead of returning the first page found
change lower search range stop condition to fix parsing bug on lowest
window
refs #27610
- - - - -
1 changed file:
- modules/demux/oggseek.c
Changes:
=====================================
modules/demux/oggseek.c
=====================================
@@ -270,23 +270,32 @@ void Oggseek_ProbeEnd( demux_t *p_demux )
{
/* We found at least a page with valid granule */
p_sys->i_length = __MAX( p_sys->i_length, i_length - VLC_TICK_0 );
- goto clean;
}
break;
}
}
}
+ if( i_startpos == i_lowerbound ||
+ p_sys->i_length != VLC_TICK_INVALID )
+ goto clean;
+
+ int64_t i_next_upperbound = __MIN(i_startpos + MIN_PAGE_SIZE, i_upperbound);
+
/* Otherwise increase read size, starting earlier */
- if ( i_backoffset <= ( UINT_MAX >> 1 ) )
+ if ( i_backoffset <= MAX_PAGE_SIZE )
{
i_backoffset <<= 1;
i_startpos = i_upperbound - i_backoffset;
}
else
{
- i_startpos -= i_backoffset;
+ i_startpos = i_upperbound - MAX_PAGE_SIZE;
}
+
+ i_upperbound = i_next_upperbound;
+
+ i_startpos = __MAX( i_startpos, i_lowerbound );
i_pos = i_startpos;
if ( vlc_stream_Seek( p_demux->s, i_pos ) )
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/efcb930b250de59dbaad59a4e5364292a32188b1
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/efcb930b250de59dbaad59a4e5364292a32188b1
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the vlc-commits
mailing list