GNOME Bugzilla – Bug 746439
task: guard against NULL task function in gst_task_new()
Last modified: 2015-08-16 13:36:41 UTC
function gst_task_new function should check for the NULL value for GstTaskFunction. gst_task_new function gives the valid GstTask object which cause the segmentation fault in gst_task_func().
Created attachment 299792 [details] [review] gsttask: function- gst_task_new. Checking NULL value for GstTaskFunction argument. Please review the patch attached for the issue
Thanks, I have pushed this now, but just in general: there is no requirement for every function to have function guards. These are optional and they only aid programmers to avoid and spot basic mistakes. All these g_return_{val}_if_*() are usually compiled out on embedded systems. It is never valid to pass a NULL function to gst_task_new(), and it is ok and epxected that GStreamer crashes when that happens. It's C. g_return_*() doesn't offer any protection really, since it is often compiled out. commit 03dccde1ef977ed7d57b445ab4efbd10a23e60f0 Author: Prashant Gotarne <ps.gotarne@samsung.com> Date: Thu Mar 19 15:55:14 2015 +0530 task: guard against NULL task function https://bugzilla.gnome.org/show_bug.cgi?id=746439