GNOME Bugzilla – Bug 710758
gst-launch: assert if we can't get gst sample
Last modified: 2013-11-01 14:16:16 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
Created attachment 257973 [details] [review] gst-launch: asset if we can't get gst sample
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?
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.
Created attachment 258020 [details] [review] gst-launch: fix potential uninitialized variable warning
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()
Created attachment 258732 [details] [review] gst-launch: fix potential uninitialized variable warning
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