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 710758 - gst-launch: assert if we can't get gst sample
gst-launch: assert if we can't get gst sample
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Mac OS
: Normal normal
: 1.3.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-10-23 21:40 UTC by Matthieu Bouron
Modified: 2013-11-01 14:16 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gst-launch: asset if we can't get gst sample (868 bytes, patch)
2013-10-23 21:41 UTC, Matthieu Bouron
none Details | Review
gst-launch: fix potential uninitialized variable warning (1.76 KB, patch)
2013-10-24 13:34 UTC, Matthieu Bouron
needs-work Details | Review
gst-launch: fix potential uninitialized variable warning (1.88 KB, patch)
2013-11-01 14:04 UTC, Matthieu Bouron
committed Details | Review

Description Matthieu Bouron 2013-10-23 21:40:54 UTC
Assert if we can't get gst sample in the print_tag function since it's not supposed to happen here.
This also fixes the use a potential uninitialized variable (str) and helps compilation with osx >= 10.8.5 using apple llvm 5.0
Comment 1 Matthieu Bouron 2013-10-23 21:41:44 UTC
Created attachment 257973 [details] [review]
gst-launch: asset if we can't get gst sample
Comment 2 Tim-Philipp Müller 2013-10-24 10:09:18 UTC
I am not sure it makes sense to add code like this for stuff that should never happen. Also, keep in mind that g_assert_not_reached() will not always evaluate to something. Could you paste the full compiler warning for reference as well please?
Comment 3 Matthieu Bouron 2013-10-24 13:21:43 UTC
The warning is about str being used uninitialized if gst_tag_list_get_sample_index returns false.
Well i guess the correct way to fix the problem is to initialize str at NULL, output a warning if gst_tag_list_get_sample_index returns false and check str before usage at the end of the function. Does it sounds good to you ?

Note: this can also be valid if gst_tag_list_get_string_index returns false.
Comment 4 Matthieu Bouron 2013-10-24 13:34:12 UTC
Created attachment 258020 [details] [review]
gst-launch: fix potential uninitialized variable warning
Comment 5 Sebastian Dröge (slomo) 2013-10-30 21:01:42 UTC
Review of attachment 258020 [details] [review]:

As this should all never happen, make them g_warnings() at least and possibly also keep g_assert_not_reached()
Comment 6 Matthieu Bouron 2013-11-01 14:04:02 UTC
Created attachment 258732 [details] [review]
gst-launch: fix potential uninitialized variable warning
Comment 7 Sebastian Dröge (slomo) 2013-11-01 14:16:12 UTC
commit a0e2eb61692c56edc84de378119c353d828bc577
Author: Matthieu Bouron <matthieu.bouron@collabora.com>
Date:   Wed Oct 23 15:56:20 2013 +0100

    gst-launch: fix potential uninitialized variable warning
    
    https://bugzilla.gnome.org/show_bug.cgi?id=710758