! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Segfault when showing the thumbnail bar if no images are available.
Status:
RESOLVED: FIXED
Product:
Ristretto
Component:
Application

Comments

Description David Schneider 2012-02-16 21:02:31 CET
Created attachment 4213 
Fixes the crash

Steps to reproduce:
1. Run Ristretto without arguments in a folder without images.
2. Use the menu to hide and then show the thumbnail bar.
3. Crash!

The icon bar size_allocate callback dereferences active_item when none exists.  Simply preventing the crash makes the thumbnail bar appear, but without any images, it has no width and looks bad (it really shouldn't appear to begin with).

The attached patch does a few things to remedy the problem and similar undiscovered problems:
Direct: The menu item only actually shows the thumbnail bar if there are items to display.
Reactive: active_item is only dereferenced in the size_allocate callback if it is not NULL.
Proactive: if size_allocate gets called when active_item is NULL, a g_warning is printed.
Comment 1 Stephan Arts editbugs 2012-02-20 19:49:45 CET
Thanks, committed the patch to master.

Bug #8479

Reported by:
David Schneider
Reported on: 2012-02-16
Last modified on: 2012-02-20

People

Assignee:
Stephan Arts
CC List:
0 users

Version

Version:
master

Attachments

Fixes the crash (2.07 KB, patch)
2012-02-16 21:02 CET , David Schneider
no flags

Additional information