aboutsummaryrefslogtreecommitdiffstats
path: root/ui/qt/rtp_audio_stream.cpp
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2015-10-26 03:13:08 -0700
committerGuy Harris <guy@alum.mit.edu>2015-10-26 10:13:43 +0000
commit4ce9655658d9546ba7459aa80ff9a6be1381708e (patch)
tree7280cc7f18fe2c81203c5fc71926288d40aa7bda /ui/qt/rtp_audio_stream.cpp
parentfb72cad4e87e1ed37c6e0624a5c7c75bba6ee394 (diff)
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 <guy@alum.mit.edu>
Diffstat (limited to 'ui/qt/rtp_audio_stream.cpp')
-rw-r--r--ui/qt/rtp_audio_stream.cpp7
1 files 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 <gerald@wireshark.org>
@@ -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_;