After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 576928 - Brasero crashes when pasting empty clipboard
Brasero crashes when pasting empty clipboard
Status: RESOLVED FIXED
Product: brasero
Classification: Applications
Component: general
2.26.0
Other Linux
: Normal critical
: 2.26
Assigned To: Brasero maintainer(s)
Brasero maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2009-03-27 03:54 UTC by Andreas Moog
Modified: 2009-03-29 19:06 UTC
See Also:
GNOME target: ---
GNOME version: 2.25/2.26


Attachments
Check for n_atoms > 0 (383 bytes, patch)
2009-03-27 16:54 UTC, palfrey
committed Details | Review

Description Andreas Moog 2009-03-27 03:54:20 UTC
Steps:

1. Make sure clipboard is empty
2. Open brasero
3. Create new audio project
4. CTRL-V
5. crash:

Backtrace:

  • #0 brasero_audio_disc_clipboard_targets_cb
    at brasero-audio-disc.c line 3462
  • #1 request_targets_received_func
    at /build/buildd/gtk+2.0-2.16.0/gtk/gtkclipboard.c line 1221
  • #2 selection_received
    at /build/buildd/gtk+2.0-2.16.0/gtk/gtkclipboard.c line 868
  • #3 _gtk_marshal_VOID__BOXED_UINT
    at /build/buildd/gtk+2.0-2.16.0/gtk/gtkmarshalers.c line 1461
  • #4 IA__g_closure_invoke
    at /build/buildd/glib2.0-2.20.0/gobject/gclosure.c line 767
  • #5 signal_emit_unlocked_R
    at /build/buildd/glib2.0-2.20.0/gobject/gsignal.c line 3244
  • #6 IA__g_signal_emit_valist
    at /build/buildd/glib2.0-2.20.0/gobject/gsignal.c line 2977
  • #7 IA__g_signal_emit_by_name
    at /build/buildd/glib2.0-2.20.0/gobject/gsignal.c line 3071
  • #8 gtk_selection_retrieval_report
    at /build/buildd/gtk+2.0-2.16.0/gtk/gtkselection.c line 2939
  • #9 _gtk_selection_notify
    at /build/buildd/gtk+2.0-2.16.0/gtk/gtkselection.c line 2720
  • #10 _gtk_marshal_BOOLEAN__BOXED
    at /build/buildd/gtk+2.0-2.16.0/gtk/gtkmarshalers.c line 84
  • #11 g_type_class_meta_marshal
    at /build/buildd/glib2.0-2.20.0/gobject/gclosure.c line 878
  • #12 IA__g_closure_invoke
    at /build/buildd/glib2.0-2.20.0/gobject/gclosure.c line 767
  • #13 signal_emit_unlocked_R
    at /build/buildd/glib2.0-2.20.0/gobject/gsignal.c line 3282
  • #14 IA__g_signal_emit_valist
    at /build/buildd/glib2.0-2.20.0/gobject/gsignal.c line 2987
  • #15 IA__g_signal_emit
    at /build/buildd/glib2.0-2.20.0/gobject/gsignal.c line 3034
  • #16 gtk_widget_event_internal
    at /build/buildd/gtk+2.0-2.16.0/gtk/gtkwidget.c line 4761
  • #17 IA__gtk_main_do_event
    at /build/buildd/gtk+2.0-2.16.0/gtk/gtkmain.c line 1579
  • #18 gdk_event_dispatch
    at /build/buildd/gtk+2.0-2.16.0/gdk/x11/gdkevents-x11.c line 2364
  • #19 IA__g_main_context_dispatch
    at /build/buildd/glib2.0-2.20.0/glib/gmain.c line 1814
  • #20 g_main_context_iterate
    at /build/buildd/glib2.0-2.20.0/glib/gmain.c line 2448
  • #21 IA__g_main_loop_run
    at /build/buildd/glib2.0-2.20.0/glib/gmain.c line 2656
  • #22 IA__gtk_main
    at /build/buildd/gtk+2.0-2.16.0/gtk/gtkmain.c line 1205
  • #23 main
    at main.c line 476

Other info:

Reported on Launchpad:

https://bugs.launchpad.net/bugs/345177
Comment 1 palfrey 2009-03-27 16:54:52 UTC
Created attachment 131505 [details] [review]
Check for n_atoms > 0

For C (IIRC), 0 is 'false' and all non-zero values are true, therefore when -1 was used as a "no atoms" value, the loop got evaluated, when it was expecting to be able to count downwards from a positive value to 0.

This patch fixes this by changing the test from "while (n_atoms)" to "while (n_atoms > 0)".
Comment 2 Luis Medinas 2009-03-29 19:06:31 UTC
The patch looks good i applied to both gnome 2.26 branch and trunk. 
Thanks

2009-03-29  Luis Medinas  <lmedinas@gnome.org>

        * src/brasero-audio-disc.c
        (brasero_audio_disc_clipboard_targets_cb):

        Fix bgo #576928 – Brasero crashes when pasting empty clipboard.
        Patch from Tom Parker <palfrey@tevp.net>