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 708161 - mpegtspacketizer: rework packet extraction and sync
mpegtspacketizer: rework packet extraction and sync
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
1.1.4
Other Linux
: Normal normal
: 1.2.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-09-16 13:53 UTC by Arnaud Vrac
Modified: 2013-09-30 08:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
mpegtspacketizer: rework TS packet sync and extraction (13.76 KB, patch)
2013-09-16 13:53 UTC, Arnaud Vrac
none Details | Review
tsdemux: fix buffer overflow (1.62 KB, patch)
2013-09-16 13:55 UTC, Arnaud Vrac
committed Details | Review
mpegtspacketizer: rework TS packet sync and extraction (14.02 KB, patch)
2013-09-25 15:14 UTC, Arnaud Vrac
committed Details | Review

Description Arnaud Vrac 2013-09-16 13:53:31 UTC
Created attachment 255028 [details] [review]
mpegtspacketizer: rework TS packet sync and extraction

I've found some issues in the TS parsing code while playing with the breakmydata element. The sync scan code in mpegtspacketizer is pretty confusing, and can easily be blocked in an infinite loop when sync is lost.

I've rewritten this code to make it much clearer IMHO, and I've tested it with against a few TS files with breakmydata.
Comment 1 Arnaud Vrac 2013-09-16 13:55:17 UTC
Created attachment 255029 [details] [review]
tsdemux: fix buffer overflow

This patch fixes a buffer overflow found while playing with breakmydata
Comment 2 Arnaud Vrac 2013-09-25 15:14:48 UTC
Created attachment 255701 [details] [review]
mpegtspacketizer: rework TS packet sync and extraction

Fix gsize printf format warnings
Comment 3 Sebastian Dröge (slomo) 2013-09-27 13:19:05 UTC
commit 467e0151d3fa733fb34dac3438d1ef357d171641
Author: Arnaud Vrac <avrac@freebox.fr>
Date:   Mon Sep 16 11:46:27 2013 +0200

    mpegtspacketizer: rework TS packet sync and extraction
    
    The previous code could enter an infinite loop because the adapter state
    could get out of sync with its mapped data state after sync was lost.
    The code was pretty confusing so it's been rewritten to be clearer.
    
    The easiest way to reproduce the infinite loop is to use the breakmydata
    element before tsdemux to trigger a resync.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=708161

commit 85ad4f3ad6234e425ebf3f4c58f36597a48e4e41
Author: Arnaud Vrac <avrac@freebox.fr>
Date:   Mon Sep 16 11:42:48 2013 +0200

    tsdemux: fix buffer overflow
    
    This can happen with a corrupt TS file, found with breakmydata element
    plugged before tsdemux.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=708161