GNOME Bugzilla – Bug 655540
mpegtsbase: gst_structure_id_get() called with wrong type
Last modified: 2011-08-01 07:37:24 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.
"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.
(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.
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