From b02a0ee48a51ccbb33ad76ce84ecb05409a6973a Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Thu, 1 Oct 2015 16:56:01 +0200 Subject: Fix crashes related to RTP Streams analysis The data that describes RTP streams become invalid when packets are re-dissected. This results in a crash in GTK when the "RTP Analyse" option is used and and a crash in Qt when the display filter is changed while the RTP Streams dialog is open. Fix this by adding a tap_reset callback (modelled after mcaststream) to the RTP tap listener that allows the GTK+ and Qt dialogs to clear the displayed list of RTP streams. Bug: 10016 Change-Id: I7478678db63d7ac8110c44c163844e9f66fad9e9 Reviewed-on: https://code.wireshark.org/review/10728 Reviewed-by: Peter Wu Petri-Dish: Peter Wu Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann --- ui/qt/rtp_stream_dialog.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'ui/qt/rtp_stream_dialog.cpp') diff --git a/ui/qt/rtp_stream_dialog.cpp b/ui/qt/rtp_stream_dialog.cpp index 52f96008b0..fa77c8e864 100644 --- a/ui/qt/rtp_stream_dialog.cpp +++ b/ui/qt/rtp_stream_dialog.cpp @@ -265,6 +265,7 @@ RtpStreamDialog::RtpStreamDialog(QWidget &parent, CaptureFile &cf) : /* Register the tap listener */ memset(&tapinfo_, 0, sizeof(rtpstream_tapinfo_t)); + tapinfo_.tap_reset = tapReset; tapinfo_.tap_draw = tapDraw; tapinfo_.tap_mark_packet = tapMarkPacket; tapinfo_.tap_data = this; @@ -314,6 +315,15 @@ bool RtpStreamDialog::eventFilter(QObject *, QEvent *event) return false; } +void RtpStreamDialog::tapReset(rtpstream_tapinfo_t *tapinfo) +{ + RtpStreamDialog *rtp_stream_dialog = dynamic_cast((RtpStreamDialog *)tapinfo->tap_data); + if (rtp_stream_dialog) { + /* invalidate items which refer to old strinfo_list items. */ + rtp_stream_dialog->ui->streamTreeWidget->clear(); + } +} + void RtpStreamDialog::tapDraw(rtpstream_tapinfo_t *tapinfo) { RtpStreamDialog *rtp_stream_dialog = dynamic_cast((RtpStreamDialog *)tapinfo->tap_data); -- cgit v1.2.3