Commit 3b49f979 authored by Bastien Nocera's avatar Bastien Nocera

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 #304
parent 9fc159a9
Pipeline #63868 passed with stages
in 11 minutes and 29 seconds
......@@ -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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment