mpegtsbase: Prevent stack gardening by using the right type
authorNicolas Dufresne <nicolas.dufresne@collabora.com>
Thu, 28 Jul 2011 22:21:04 +0000 (18:21 -0400)
committerEdward Hervey <edward.hervey@collabora.co.uk>
Mon, 1 Aug 2011 07:33:25 +0000 (09:33 +0200)
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

gst/mpegtsdemux/mpegtsbase.c

index ac4b615..e3be7c8 100644 (file)
@@ -615,7 +615,7 @@ mpegts_base_activate_program (MpegTSBase * base, MpegTSBaseProgram * program,
   guint i, nbstreams;
   guint pcr_pid;
   guint pid;
-  guint16 stream_type;
+  guint stream_type;
   GstStructure *stream;
   const GValue *new_streams;
   const GValue *value;