Skip to content
Snippets Groups Projects
Commit 6183d1e1 authored by François Cartegnie's avatar François Cartegnie :fingers_crossed: Committed by Jean-Baptiste Kempf
Browse files

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

(cherry picked from commit efcb930b)
parent 767b44f0
No related branches found
No related tags found
2 merge requests!3533Backport MR 3236 to 3.0.x,!2992[3.0] demux: ogg: fix last page probing
Pipeline #296529 passed with stages
in 19 minutes and 23 seconds
......@@ -276,22 +276,30 @@ void Oggseek_ProbeEnd( demux_t *p_demux )
break;
}
}
/* We found at least a page with valid granule */
if ( i_length > 0 ) break;
}
/* We found at least a page with valid granule */
if ( i_length > 0 ) break;
if( i_startpos == i_lowerbound ||
p_sys->i_length != 0 )
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 ) )
......
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