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 655540 - mpegtsbase: gst_structure_id_get() called with wrong type
mpegtsbase: gst_structure_id_get() called with wrong type
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal normal
: 0.10.23
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-07-28 22:25 UTC by Nicolas Dufresne (ndufresne)
Modified: 2011-08-01 07:37 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix stack gardening (1.04 KB, patch)
2011-07-28 22:25 UTC, Nicolas Dufresne (ndufresne)
committed Details | Review

Description Nicolas Dufresne (ndufresne) 2011-07-28 22:25:42 UTC
Created attachment 192838 [details] [review]
Fix stack gardening

Attached a patch that fixes stack gardening when compile in -O0 where no padding is added to the stack.
Comment 1 David Schleef 2011-07-29 00:13:39 UTC
"stack gardening"?  I think you mean something different.

In any case, the commit message could be simpler: gst_structure_id_get() called with the wrong type.

Otherwise, looks good.
Comment 2 Nicolas Dufresne (ndufresne) 2011-07-29 02:57:34 UTC
(In reply to comment #1)
> "stack gardening"?  I think you mean something different.
> 
> In any case, the commit message could be simpler: gst_structure_id_get() called
> with the wrong type.

Not only the wrong type here, the wrong type size. In this case the 16bit variable get filled as if it was 32bit, overwriting the next variable on the stack.
Comment 3 Edward Hervey 2011-08-01 07:37:14 UTC
commit cbc0a2f056aced60c7e8c8be861a18e0743f5af2
Author: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Date:   Thu Jul 28 18:21:04 2011 -0400

    mpegtsbase: Prevent stack gardening by using the right type
    
    stream_type is stored as guint inside the GstStructure but was retreived
    using valist with a pointer to guint16. This would cause stack gardening
    when code is compiled without optimisation (e.g. in -O0 the compiler wont
    pad the stack to optimise out required mask).
    
    https://bugzilla.gnome.org/show_bug.cgi?id=655540