Skip to content

ogg: fix parsing skeleton packets with invalid granulepos

Kakadus requested to merge Kakadus/vlc:ogg-skeleton-granulepos-fix into master

All ogg skeleton streams have a zero dts notably, the denominator is also zero. Calling Ogg_GranuleToTime fails with the assertion assert( p_date->i_divider_num != 0 ) (division by zero later) in date_Increment.

It is called when the skeleton stream has a data page with "valid" granule position > 0. Then, the numerator is set to 1 in Ogg_SampleToTime which finally causes the assertion.

See the example files for some instances: Invalid granulepos on the first (fishead) page: fishead-crash.ogg
Invalid granulepos on invalid data page for skeleton stream: data-crash.ogg

As skeleton streams should not have any data packets in the first place, we should be able to return early, which this MR proposes.

Merge request reports