[gnome-music/wip/mschraal/albumsview-cover-on-demand-fixes: 1/2] albumsview: Fix issue with zero sized covers
- From: Marinus Schraal <mschraal src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/mschraal/albumsview-cover-on-demand-fixes: 1/2] albumsview: Fix issue with zero sized covers
- Date: Wed, 6 Nov 2019 19:37:36 +0000 (UTC)
commit dd9c8a61b55b9d6b4809512fc3bc6c7863f9f032
Author: Marinus Schraal <mschraal gnome org>
Date: Wed Nov 6 17:08:37 2019 +0100
albumsview: Fix issue with zero sized covers
In some circumstances the AlbumCover size might still be 0x0, triggering
a division by zero.
Check for AlbumCover size being 0 and stop cover retrieval.
gnomemusic/views/albumsview.py | 3 +++
1 file changed, 3 insertions(+)
---
diff --git a/gnomemusic/views/albumsview.py b/gnomemusic/views/albumsview.py
index 7836f86d..09502357 100644
--- a/gnomemusic/views/albumsview.py
+++ b/gnomemusic/views/albumsview.py
@@ -112,6 +112,9 @@ class AlbumsView(Gtk.Stack):
first_cover = self._flowbox.get_child_at_index(0)
cover_size, _ = first_cover.get_allocated_size()
+ if cover_size.width == 0 or cover_size.height == 0:
+ return GLib.SOURCE_REMOVE
+
viewport_size, _ = self._viewport.get_allocated_size()
h_space = self._flowbox.get_column_spacing()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]