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 611895 - Check return value of functions
Check return value of functions
Status: RESOLVED WONTFIX
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Linux
: Normal trivial
: NONE
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-03-05 12:15 UTC by Miguel Angel Cabrera Moya
Modified: 2010-03-24 17:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch that fixes this (812 bytes, patch)
2010-03-05 12:15 UTC, Miguel Angel Cabrera Moya
rejected Details | Review

Description Miguel Angel Cabrera Moya 2010-03-05 12:15:29 UTC
Created attachment 155299 [details] [review]
Patch that fixes this

When calling gst_structure_get_clock_time in file gstbasertpdepayload.c return values are not checked
Comment 1 Olivier Crête 2010-03-05 15:41:59 UTC
Review of attachment 155299 [details] [review]:

It shouldn't be necessary. If they get functions fail, the timestamp/duration variables are not modified.
Comment 2 Miguel Angel Cabrera Moya 2010-03-05 16:18:51 UTC
Review of attachment 155299 [details] [review]:

I know, but this way you have two assignments less in the case the functions doesn't fail.
Comment 3 Olivier Crête 2010-03-05 16:45:51 UTC
But you have a condition instead, I'm not sure what the gain is.
Comment 4 Miguel Angel Cabrera Moya 2010-03-05 16:49:44 UTC
In theory is a good practice to check the return value of every function, so do the test for the return value and use it for something useful.

Also apart of doing the assignment maybe would be good to put a warning.
Comment 5 Tim-Philipp Müller 2010-03-24 17:55:02 UTC
Since there's no real bug being fixed here, I don't see the point in touching the code for no other reason than minor style issues. The way the getters are used here seems fine to me, and if that's the preference of the people maintaining the code, let's keep it that way.

(If anyone ever changes this code, they may want to check against GST_CLOCK_TIME_NONE rather than -1 as well btw ;)).