[Bug 797092] opusenc: segmentation fault

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Thu Sep 13 22:21:55 UTC 2018


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

--- Comment #11 from Nicolas Dufresne (ndufresne) <nicolas at ndufresne.ca> ---
(In reply to Marcos Kintschner from comment #8)
> I think the error is happening in the gst_structure_set_valist_internal
> function of gststructure.c.
> 
> There's a while loop that reads the args from varargs until it finds "NULL".
> 
> while (fieldname) {
>    ...
>    type = va_arg (varargs, GType); // gets type
>    ...
>    G_VALUE_COLLECT_INIT (&field.value, type, varargs, 0, &err); // gets value
>    ...
>    fieldname = va_arg (varargs, gchar *); // gets next field from vargs
> }
> 
> The varargs is:
> va_list varargs = G_TYPE_INT, 2, "channel-mask", GST_TYPE_BITMASK, 0x0, NULL 
> 
> 
> He should read:
> type = G_TYPE_INT
> value = 2
> fieldname = "channel-mask"
> type = GST_TYPE_BITMASK
> value = 0
> fielname = NULL //should end here, but it's not what's happening

Good catch, GST_TYPE_BITMASK is a 64bit type, 0x0 is 32bit, so we'll be off by
32bit, reading after the NULL sentinel. Can be fixed with "G_GUINT64_CONSTANT
(0)", do you wan to provide a patch ?

-- 
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