infinite-loop-thumbnailer.patch 3.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. From e7046d564a6f76c1af8f5640ac9c569e07284ec0 Mon Sep 17 00:00:00 2001
  2. From: Bastien Nocera <hadess@hadess.net>
  3. Date: Fri, 18 Sep 2020 12:06:45 +0200
  4. Subject: [PATCH] Fix infinite loop if thumbnailer is not available
  5. The code in cheese_thumb_view_idle_append_item() in
  6. src/thumbview/cheese-thumb-view.c didn't pop the list of items to
  7. thumbnail if thumbnailing failed.
  8. #0 0x00007f4a60e55314 in open64 () at /lib64/libc.so.6
  9. #1 0x00007f4a60de6386 in _IO_file_open () at /lib64/libc.so.6
  10. #2 0x00007f4a60de655a in __GI__IO_file_fopen () at /lib64/libc.so.6
  11. #3 0x00007f4a60dd9aad in __fopen_internal () at /lib64/libc.so.6
  12. #4 0x00007f4a6157a43f in gdk_pixbuf_new_from_file () at /lib64/libgdk_pixbuf-2.0.so.0
  13. #5 0x00007f4a61e84b3a in gnome_desktop_thumbnail_factory_lookup () at /lib64/libgnome-desktop-3.so.19
  14. #6 0x000055cef476046f in cheese_thumb_view_idle_append_item ()
  15. #7 0x00007f4a6124f47b in g_idle_dispatch () at /lib64/libglib-2.0.so.0
  16. #8 0x00007f4a612537af in g_main_context_dispatch () at /lib64/libglib-2.0.so.0
  17. #9 0x00007f4a61253b38 in g_main_context_iterate.constprop () at /lib64/libglib-2.0.so.0
  18. #10 0x00007f4a61253c03 in g_main_context_iteration () at /lib64/libglib-2.0.so.0
  19. #11 0x00007f4a6146a7ca in g_application_run () at /lib64/libgio-2.0.so.0
  20. #12 0x000055cef4758547 in _vala_main ()
  21. #13 0x00007f4a60d8a042 in __libc_start_main () at /lib64/libc.so.6
  22. #14 0x000055cef47554be in _start ()
  23. #0 0x00007f4a60ec562d in __strlen_avx2 () at /lib64/libc.so.6
  24. #1 0x00007f4a61275de8 in g_str_has_suffix () at /lib64/libglib-2.0.so.0
  25. #2 0x00007f4a618c0072 in icon_name_is_symbolic () at /lib64/libgtk-3.so.0
  26. #3 0x00007f4a618c00b1 in theme_dir_get_icon_suffix () at /lib64/libgtk-3.so.0
  27. #4 0x00007f4a618c32ed in theme_lookup_icon () at /lib64/libgtk-3.so.0
  28. #5 0x00007f4a618c3adf in real_choose_icon () at /lib64/libgtk-3.so.0
  29. #6 0x00007f4a618c4762 in gtk_icon_theme_lookup_icon_for_scale () at /lib64/libgtk-3.so.0
  30. #7 0x00007f4a618c5105 in gtk_icon_theme_load_icon_for_scale () at /lib64/libgtk-3.so.0
  31. #8 0x000055cef47605c9 in cheese_thumb_view_idle_append_item ()
  32. #9 0x00007f4a6124f47b in g_idle_dispatch () at /lib64/libglib-2.0.so.0
  33. #10 0x00007f4a612537af in g_main_context_dispatch () at /lib64/libglib-2.0.so.0
  34. #11 0x00007f4a61253b38 in g_main_context_iterate.constprop () at /lib64/libglib-2.0.so.0
  35. #12 0x00007f4a61253c03 in g_main_context_iteration () at /lib64/libglib-2.0.so.0
  36. #13 0x00007f4a6146a7d8 in g_application_run () at /lib64/libgio-2.0.so.0
  37. #14 0x000055cef4758547 in _vala_main ()
  38. #15 0x00007f4a60d8a042 in __libc_start_main () at /lib64/libc.so.6
  39. #16 0x000055cef47554be in _start ()
  40. Closes: #81
  41. ---
  42. src/thumbview/cheese-thumb-view.c | 5 +++--
  43. 1 file changed, 3 insertions(+), 2 deletions(-)
  44. diff --git a/src/thumbview/cheese-thumb-view.c b/src/thumbview/cheese-thumb-view.c
  45. index 1d2d88f5..232fd4b6 100644
  46. --- a/src/thumbview/cheese-thumb-view.c
  47. +++ b/src/thumbview/cheese-thumb-view.c
  48. @@ -92,7 +92,7 @@ GtkWidget * cheese_thumb_view_new (void);
  49. static gboolean
  50. cheese_thumb_view_idle_append_item (gpointer data)
  51. {
  52. - CheeseThumbViewIdleData *item = g_queue_peek_head (data);
  53. + CheeseThumbViewIdleData *item = g_queue_pop_head (data);
  54. CheeseThumbView *thumb_view;
  55. CheeseThumbViewPrivate *priv;
  56. @@ -119,6 +119,7 @@ cheese_thumb_view_idle_append_item (gpointer data)
  57. if (!info)
  58. {
  59. g_warning ("Invalid filename\n");
  60. + g_slice_free (CheeseThumbViewIdleData, item);
  61. return TRUE;
  62. }
  63. g_file_info_get_modification_time (info, &mtime);
  64. @@ -167,6 +168,7 @@ cheese_thumb_view_idle_append_item (gpointer data)
  65. if (error)
  66. {
  67. g_warning ("%s", error->message);
  68. + g_slice_free (CheeseThumbViewIdleData, item);
  69. return TRUE;
  70. }
  71. }
  72. @@ -183,7 +185,6 @@ cheese_thumb_view_idle_append_item (gpointer data)
  73. g_object_unref (pixbuf);
  74. g_object_unref (file);
  75. g_slice_free (CheeseThumbViewIdleData, item);
  76. - g_queue_pop_head (data);
  77. return TRUE;
  78. }
  79. --
  80. GitLab