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 746439 - task: guard against NULL task function in gst_task_new()
task: guard against NULL task function in gst_task_new()
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal minor
: 1.5.90
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-03-19 10:16 UTC by Prashant Gotarne
Modified: 2015-08-16 13:36 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gsttask: function- gst_task_new. Checking NULL value for GstTaskFunction argument. (860 bytes, patch)
2015-03-19 10:27 UTC, Prashant Gotarne
none Details | Review

Description Prashant Gotarne 2015-03-19 10:16:07 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().
Comment 1 Prashant Gotarne 2015-03-19 10:27:32 UTC
Created attachment 299792 [details] [review]
gsttask: function- gst_task_new. Checking NULL value for  GstTaskFunction argument.

Please review the patch attached for the issue
Comment 2 Tim-Philipp Müller 2015-06-25 08:59:54 UTC
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