From 4ce9655658d9546ba7459aa80ff9a6be1381708e Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Mon, 26 Oct 2015 03:13:08 -0700 Subject: [PATCH] Don't use the non-existent decoded data if decode_rtp_packet() returns 0. Just skip that packet. Otherwise, it crashes. Fix file name in the introductory comment while we're at it. Change-Id: I286f4303a4ec152c0d00c5135395c1608bf2121a Reviewed-on: https://code.wireshark.org/review/11279 Reviewed-by: Guy Harris --- ui/qt/rtp_audio_stream.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ui/qt/rtp_audio_stream.cpp b/ui/qt/rtp_audio_stream.cpp index d66ce9edef..eaa3c48514 100644 --- a/ui/qt/rtp_audio_stream.cpp +++ b/ui/qt/rtp_audio_stream.cpp @@ -1,4 +1,4 @@ -/* rtp_audio_frame.h +/* rtp_audio_frame.cpp * * Wireshark - Network traffic analyzer * By Gerald Combs @@ -197,8 +197,9 @@ void RtpAudioStream::decode() payload_names_ << payload_name; } - //size_t decoded_bytes = - decode_rtp_packet(rtp_packet, &decode_buff, decoders_hash_, &channels, &sample_rate); + size_t decoded_bytes = decode_rtp_packet(rtp_packet, &decode_buff, decoders_hash_, &channels, &sample_rate); + if (decoded_bytes == 0) + continue; /* Didn't decode anything */ write_buff = (char *) decode_buff; write_bytes = rtp_packet->info->info_payload_len * sample_bytes_;