[Bug 788133] Fix problems with GstVideoInfo

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Mon Sep 25 22:02:59 UTC 2017


https://bugzilla.gnome.org/show_bug.cgi?id=788133

--- Comment #2 from Thibault Saunier <tsaunier at gnome.org> ---
Created attachment 360392
  --> https://bugzilla.gnome.org/attachment.cgi?id=360392&action=edit
Fix problems with GstVideoInfo

The ABI union member was missing from the C# representation of
GstVideoInfo, which means the size of the C# struct was 32 bytes
smaller than the actual struct. This caused heap corruption when
e.g. calling VideoInfo.Init(), since the binding uses AllocHGlobal to
allocate temporary storage for the GstVideoInfo struct (but only
allocates a number of bytes equal to the size of the C# struct), and
then passes a pointer to the allocated memory to gst_video_info_*()
functions. When gst_video_info_init() is called, it does a memset with
sizeof(GstVideoInfo), which results in an out-of-bounds write.

With this change, padding bytes equal to the size of the ABI union are
added to the generated C# struct.

Also suppressed the auto-generated .Equals() method, and instead
implemented it to call IsEqual() (gst_video_info_is_equal).

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list