From 8ba94798ec1506b86abf9418a3fb849d375e62b6 Mon Sep 17 00:00:00 2001 From: Gerald Combs Date: Mon, 13 Jul 2015 11:46:46 -0700 Subject: [PATCH] GTK: Don't crash when we click on an RTP sample. This doesn't fix any of the underlying problems discussed in bug 10613 but it does keep us from dereferencing a NULL pointer. Change-Id: I9317366a6ae6e563dcadb32bccee87e8803c37e3 Ping-Bug: 10613. Reviewed-on: https://code.wireshark.org/review/9626 Reviewed-by: Gerald Combs --- ui/gtk/rtp_player.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/gtk/rtp_player.c b/ui/gtk/rtp_player.c index 3b0e0e2daa..1894bd7556 100644 --- a/ui/gtk/rtp_player.c +++ b/ui/gtk/rtp_player.c @@ -896,7 +896,7 @@ draw_channel_cursor(rtp_channel_info_t *rci, guint32 start_index) GtkAllocation widget_alloc; cairo_t *cr; - if (!rci) return; + if (!rci || !pa_stream) return; #if PORTAUDIO_API_1 idx = Pa_StreamTime( pa_stream ) - rtp_channels->pause_duration - rtp_channels->out_diff_time - start_index; @@ -2209,7 +2209,7 @@ decode_streams(void) progbar_count = 0; /* Mark the RTP streams to be played using the selected VoipCalls. If voip_calls is NULL - then this was called from "RTP Analysis" so mark all strams */ + then this was called from "RTP Analysis" so mark all streams */ if (rtp_streams_hash) { if (voip_calls) g_hash_table_foreach( rtp_streams_hash, (GHFunc)mark_rtp_stream_to_play, NULL);