[Banshee-List] [PATCH] TrackInfoDisplay pixbuf crash



Hi all,

Attached is a fix for the issue in trunk where TrackInfoDisplay would end up causing a SIGSEGV, terminating Banshee. It's only a one-liner. ;)

After the TrackInfoDisplay has finished transitioning from one song to the next, the code would dispose the current album pixbuf. What would happen is, sometimes, the incoming pixbuf would missing_pixbuf (the icon for songs without cover art). After the next transition, we'd end up disposing missing_pixbuf, so that next time we used missing_pixbuf, we'd crash, because we were using an empty image. Null checks are useless because what you'd end up with is the pixbuf object, but with -1x-1 (empty) image data.

The patch just checks to see if the pixbuf is also missing_pixbuf, and doesn't dispose it if it is.

You can reproduce the crash by playing a song that has no album art, then one that does, and finally if you click on another song without album art, you should crash. You should generally wait for the transition to finish before clicking on the next song.

Cheers,
Alex Hixon
Index: src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/TrackInfoDisplay.cs
===================================================================
--- src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/TrackInfoDisplay.cs	(revision 3022)
+++ src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/TrackInfoDisplay.cs	(working copy)
@@ -421,7 +421,7 @@
                         transition_frames / ((double)FADE_TIMEOUT / 1000.0));
                 }
                 
-                if (current_pixbuf != incoming_pixbuf) {
+                if (current_pixbuf != incoming_pixbuf && current_pixbuf != missing_pixbuf) {
                     ArtworkRenderer.DisposePixbuf (current_pixbuf);
                 }
                 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]