diff options
author | Bastien Nocera <hadess@hadess.net> | 2019-02-28 17:33:07 +0100 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2019-02-28 17:10:14 +0000 |
commit | 3b49f9794c2b8c3a2ff0b17ecad1012516d4b02f (patch) | |
tree | 86f6c9bb0dda86e2c5a998b93fa3159b04ad9ef5 /src | |
parent | 9fc159a98e06f0660ba0e8915aca88d2e6c4f852 (diff) | |
download | totem-3b49f9794c2b8c3a2ff0b17ecad1012516d4b02f.tar.gz |
main: Fix warning when "browsing too fast"
Fix possible use of an uninitialised variable, as spotted by valgrind.
(totem:28635): Gtk-CRITICAL **: 17:22:01.811: gtk_tree_model_get_iter: assertion 'path != NULL' failed
==28635== Conditional jump or move depends on uninitialised value(s)
==28635== at 0x50BCC94: gtk_tree_store_get_value (gtktreestore.c:655)
==28635== by 0x50AF14D: gtk_tree_model_get_valist (gtktreemodel.c:1798)
==28635== by 0x50AF47C: gtk_tree_model_get (gtktreemodel.c:1762)
==28635== by 0x48989C6: browse_cb (totem-grilo.c:688)
==28635== by 0x608EFE3: queue_process (grl-source.c:2088)
==28635== by 0x4994917: g_main_dispatch (gmain.c:3189)
==28635== by 0x4994917: g_main_context_dispatch (gmain.c:3854)
==28635== by 0x4994D07: g_main_context_iterate.isra.26 (gmain.c:3927)
==28635== by 0x4994D9B: g_main_context_iteration (gmain.c:3988)
==28635== by 0x4B3A71C: g_application_run (gapplication.c:2516)
==28635== by 0x10A277: main (totem.c:83)
See https://gitlab.gnome.org/GNOME/totem/issues/304
Diffstat (limited to 'src')
-rw-r--r-- | src/totem-grilo.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/totem-grilo.c b/src/totem-grilo.c index ea8413aba..3caac17ee 100644 --- a/src/totem-grilo.c +++ b/src/totem-grilo.c @@ -682,8 +682,11 @@ browse_cb (GrlSource *source, GtkTreePath *path; path = gtk_tree_row_reference_get_path (bud->ref_parent); - gtk_tree_model_get_iter (bud->model, &parent, path); - gtk_tree_path_free (path); + if (!path || + !gtk_tree_model_get_iter (bud->model, &parent, path)) { + g_clear_pointer (&path, gtk_tree_path_free); + return; + } gtk_tree_model_get (bud->model, &parent, MODEL_RESULTS_REMAINING, &remaining_expected, |