summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Danilkin <afdw@yandex.ru>2020-05-10 05:00:14 +0300
committerAnton Danilkin <afdw@yandex.ru>2020-05-10 13:52:10 +0300
commit98394ef960884af83b801824757a9a69b9bd8da0 (patch)
treeab112b741083454b24f074936ed01bbe76f34a53
parentea61e4820556e45a1c28cb720cffa7fb18c919f2 (diff)
downloadthunar-98394ef960884af83b801824757a9a69b9bd8da0.tar.gz
Add checks for 0 handles (Bug #14122)
-rw-r--r--thunar/thunar-thumbnailer.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/thunar/thunar-thumbnailer.c b/thunar/thunar-thumbnailer.c
index cfaf2c3d..5a10bf07 100644
--- a/thunar/thunar-thumbnailer.c
+++ b/thunar/thunar-thumbnailer.c
@@ -346,8 +346,15 @@ thunar_thumbnailer_queue_async_reply (GObject *proxy,
}
else if (error == NULL)
{
- /* store the handle returned by tumbler */
- job->handle = handle;
+ if (handle == 0)
+ {
+ g_printerr ("ThunarThumbnailer: got 0 handle (Queue)\n");
+ }
+ else
+ {
+ /* store the handle returned by tumbler */
+ job->handle = handle;
+ }
}
else
{
@@ -853,6 +860,12 @@ thunar_thumbnailer_thumbnailer_finished (GDBusProxy *proxy,
_thunar_return_if_fail (G_IS_DBUS_PROXY (proxy));
_thunar_return_if_fail (THUNAR_IS_THUMBNAILER (thumbnailer));
+ if (handle == 0)
+ {
+ g_printerr ("ThunarThumbnailer: got 0 handle (Finished)\n");
+ return;
+ }
+
_thumbnailer_lock (thumbnailer);
for (lp = thumbnailer->jobs; lp != NULL; lp = lp->next)
@@ -894,6 +907,12 @@ thunar_thumbnailer_idle (ThunarThumbnailer *thumbnailer,
if (G_UNLIKELY (uris == NULL))
return;
+ if (handle == 0)
+ {
+ g_printerr ("ThunarThumbnailer: got 0 handle (Error or Ready)\n");
+ return;
+ }
+
_thumbnailer_lock (thumbnailer);
/* look for the job so we don't emit unknown handles, the reason