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 339010 - segfault/undefined behavior with optional GstCaps args
segfault/undefined behavior with optional GstCaps args
Product: GStreamer
Classification: Platform
Component: gst-python
git master
Other Linux
: Normal blocker
: 0.10.4
Assigned To: Edward Hervey
Johan (not receiving bugmail) Dahlin
Depends on:
Reported: 2006-04-19 11:54 UTC by Andy Wingo
Modified: 2006-04-19 12:06 UTC
See Also:
GNOME target: ---
GNOME version: ---

Patch to fix problem (2.11 KB, patch)
2006-04-19 11:55 UTC, Andy Wingo
committed Details | Review

Description Andy Wingo 2006-04-19 11:54:24 UTC
If a GstCaps argument is marked as optional, its value after PyArgs_ParseTupleAndKeywords is currently undefined because we are not initializing the C variable. Attached patch fixes the problem -- the pdflt idiom is taken from upstream.
Comment 1 Andy Wingo 2006-04-19 11:55:28 UTC
Created attachment 63859 [details] [review]
Patch to fix problem
Comment 2 Edward Hervey 2006-04-19 12:03:01 UTC
this patch is sweet, commit ==> NOW <==
Comment 3 Andy Wingo 2006-04-19 12:05:42 UTC
2006-04-19  Andy Wingo  <>

	* gst/ (GstCapsArg.write_const_param) 
	(GstCapsArg.write_param): If there is a default value, initialize
	the py_caps variable to NULL. PyArgs_Parse* doesn't touch c
	variables if the optional arg isn't there. Fixes #339010.