aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2013-02-15 15:31:24 +0000
committerMichael Mann <mmann78@netscape.net>2013-02-15 15:31:24 +0000
commitf5d559e87906fa7c6a9af1ab7099772da81f2ca0 (patch)
tree064e7f8a54aada20d856dfc4092714bcf1a16f53 /ui
parentf95978cf08f9d29407becbc3ac8d1491254f76ac (diff)
Fix Voice RTP player crash if player is closed while playing
Bug 8065 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8065) svn path=/trunk/; revision=47674
Diffstat (limited to 'ui')
-rw-r--r--ui/gtk/rtp_player.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/ui/gtk/rtp_player.c b/ui/gtk/rtp_player.c
index 57b54994c1..e57f1f0002 100644
--- a/ui/gtk/rtp_player.c
+++ b/ui/gtk/rtp_player.c
@@ -995,22 +995,26 @@ draw_channel_cursor(rtp_channel_info_t *rci, guint32 start_index)
rci->cursor_pixbuf = gdk_pixbuf_get_from_drawable(NULL, rci->pixmap, NULL, (int) (idx/MULT), 0, 0, 0, 1, widget_alloc.height-HEIGHT_TIME_LABEL);
cr = gdk_cairo_create (rci->pixmap);
#endif
- cairo_set_line_width (cr, 1.0);
- cairo_move_to(cr, idx/MULT, 0);
- cairo_line_to(cr, idx/MULT, widget_alloc.height-HEIGHT_TIME_LABEL);
- cairo_stroke(cr);
- cairo_destroy(cr);
+ if (cr != NULL) {
+ cairo_set_line_width (cr, 1.0);
+ cairo_move_to(cr, idx/MULT, 0);
+ cairo_line_to(cr, idx/MULT, widget_alloc.height-HEIGHT_TIME_LABEL);
+ cairo_stroke(cr);
+ cairo_destroy(cr);
+ }
cr = gdk_cairo_create (gtk_widget_get_window(rci->draw_area));
+ if (cr != NULL) {
#if GTK_CHECK_VERSION(2,22,0)
- cairo_set_source_surface (cr, rci->surface, idx/MULT, 0);
+ cairo_set_source_surface (cr, rci->surface, idx/MULT, 0);
#else
- gdk_cairo_set_source_pixmap (cr, rci->pixmap, idx/MULT, 0);
+ gdk_cairo_set_source_pixmap (cr, rci->pixmap, idx/MULT, 0);
#endif
- cairo_pattern_set_extend (cairo_get_source (cr), CAIRO_EXTEND_REPEAT);
- cairo_rectangle (cr, idx/MULT, 0, 1, widget_alloc.height-HEIGHT_TIME_LABEL);
- cairo_fill (cr);
- cairo_destroy (cr);
+ cairo_pattern_set_extend (cairo_get_source (cr), CAIRO_EXTEND_REPEAT);
+ cairo_rectangle (cr, idx/MULT, 0, 1, widget_alloc.height-HEIGHT_TIME_LABEL);
+ cairo_fill (cr);
+ cairo_destroy (cr);
+ }
}
/* Disconnect the scroll bar "value" signal to not be called */