After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 579642 - [oggdemux] handle broken ogg/vorbis files better
[oggdemux] handle broken ogg/vorbis files better
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Linux
: Normal enhancement
: 0.10.24
Assigned To: Wim Taymans
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-04-20 19:14 UTC by Tim-Philipp Müller
Modified: 2009-05-12 08:45 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
fix to parse corrupted oggs better (5.39 KB, patch)
2009-04-27 14:05 UTC, Wim Taymans
committed Details | Review

Description Tim-Philipp Müller 2009-04-20 19:14:20 UTC
Just came across these two Ogg/Vorbis files (possibly ripped using S-J in late 2003/early 2004):

http://gstreamer.freedesktop.org/media/incoming/BobMarley-SoulRebel-track06.ogg
http://gstreamer.freedesktop.org/media/incoming/BobMarley-SoulRebel-track07.ogg

Both don't play with GStreamer, but with vlc/mplayer.

One errors out, according to the debug log because it can't find a chain (rotten error message though), the other just silently EOSes and playbin2 hangs forever.

oggz-validate has this to say:
serialno 0425719003: missing *** bos
536471: serialno 0425719003: Packet belongs to unknown serialno
(rinse and repeat)

Haven't investigated this further yet. Maybe it's just a WONTFIX, but then the other players play this fine and we probably created the files back in the day.
Comment 1 Wim Taymans 2009-04-27 13:34:39 UTC
Those files are seriously corrupted, they contain parts of program code and bits of two ogg files.
Comment 2 Wim Taymans 2009-04-27 14:05:49 UTC
Created attachment 133419 [details] [review]
fix to parse corrupted oggs better

We misused the ogg api, we need to continue the data we gave to the sync layer instead of repeating bits of it.
Also ignore invalid pages without bos and just post a warning when we see an unexpected serial number.
Comment 3 Tim-Philipp Müller 2009-04-27 20:25:55 UTC
Oh, didn't realise they were THAT broken. Must be filesystem corruption somewhere on my side, sorry about that and thanks for looking into this.
Comment 4 Sebastian Dröge (slomo) 2009-05-07 12:57:17 UTC
Assigning this to Wim so he doesn't forget to commit this after the freeze :)
Comment 5 Wim Taymans 2009-05-12 08:45:26 UTC
commit 7e43c107546e29857f11773762e8891690c47e50
Author: Wim Taymans <wim.taymans@collabora.co.uk>
Date:   Tue Apr 28 11:24:19 2009 +0200

    oggdemux: fix abuse of ogg API, handle broken oggs
    
    When we feed the ogg sync layer, we need to feed it contiguous data even if the
    sync layer did not consume all of it yet. This makes sure that it always finds
    the next page even for more corrupted files. Use a different read_offset for
    this purpose. since we now keep track of the sync layer, we don't have to reset
    after finding a start of a page.
    
    Add some more debug info for the error paths.
    
    Only reset the sync layer when we perform a seek operation.
    
    Avoid failure when the next chain has no bos pages but instead simply ignore it.
    
    when we receive unknown page serial numbers mid stream, don't fail but post a
    warning and hope that we get back on track later.
    
    Fixes #579642