sound-juicer crashes if cd device doesn't exist
Submitted by Mitch
Link to original bug (#579284)
Description
Steps to reproduce:
- Change you cd device (i.e move your cd to another bus and it changes the device name)
- start sound-juicer
Stack trace: Assume i've moved my cd to another bus,
$ gconftool-2 --get /apps/sound-juicer/device
/dev/hdc
$ ls -l /dev/hdc ls: /dev/hdc: No such file or directory
gdb sound-juicer GNU gdb 6.8 Copyright (C) 2008 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "i686-pc-linux-gnu"...
(gdb) r
Starting program: /usr/bin/sound-juicer
[Thread debugging using libthread_db enabled]
[New Thread 0xb6a9b700 (LWP 20356)]
Xlib: extension "RANDR" missing on display ":0.0".
Xlib: extension "Generic Event Extension" missing on display ":0.0".
Xlib: extension "Generic Event Extension" missing on display ":0.0".
Xlib: extension "Generic Event Extension" missing on display ":0.0".
[New Thread 0xb6a3bb90 (LWP 20362)]
[Thread 0xb6a3bb90 (LWP 20362) exited]
[New Thread 0xb48ddb90 (LWP 20363)]
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb6a9b700 (LWP 20356)]
0xb6d1a0eb in IA__g_object_unref (_object=0x0) at gobject.c:2380
2380 gobject.c: No such file or directory.
in gobject.c
(gdb) where
#0 0xb6d1a0eb in IA__g_object_unref (_object=0x0) at gobject.c:2380
#1 0x080564a6 in cd_drive_exists (device=0x8420fd8 "/dev/hdc") at sj-main.c:1075
#2 0x080565ac in device_changed_cb (client=0x8188b00, cnxn_id=4294967295, entry=0x8520dc0, user_data=0x1) at sj-main.c:1114
#3 0x08058c70 in main (argc=1, argv=0xbfa62344) at sj-main.c:1852
(gdb)
Other information: Just add a check to see if it exists before unreferencing it.
Version: 2.26.x