summaryrefslogtreecommitdiff
path: root/ui/qt/rtp_audio_stream.cpp
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2015-10-04 12:45:21 +0200
committerGerald Combs <gerald@wireshark.org>2015-10-04 18:44:34 +0000
commit89b227f44edf224e9f4478947319f7fffe74fcf3 (patch)
treee61bed2c7294e91f2e0ab9d4e0784f951e00e31b /ui/qt/rtp_audio_stream.cpp
parent076d07d9faed0fa694a6af204ba9978bac6e44a5 (diff)
downloadwireshark-89b227f44edf224e9f4478947319f7fffe74fcf3.tar.gz
qt: fix crash when dragging RTP player out of view
Fix invalid memory access when dragging the RTP player out of view when a stream is selected. lowerBound() returns QMap.end() when no item is found, use that instead. Found using ASAN. Change-Id: I5444a047bc242dfe481bd0581c5217030fca28f1 Reviewed-on: https://code.wireshark.org/review/10778 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'ui/qt/rtp_audio_stream.cpp')
-rw-r--r--ui/qt/rtp_audio_stream.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/ui/qt/rtp_audio_stream.cpp b/ui/qt/rtp_audio_stream.cpp
index 2945281c6b..5f9c4c8c0e 100644
--- a/ui/qt/rtp_audio_stream.cpp
+++ b/ui/qt/rtp_audio_stream.cpp
@@ -316,7 +316,7 @@ quint32 RtpAudioStream::nearestPacket(double timestamp, bool is_relative)
if (!is_relative) timestamp -= start_abs_offset_;
QMap<double, quint32>::const_iterator it = packet_timestamps_.lowerBound(timestamp);
- if (it == packet_timestamps_.begin()) return 0;
+ if (it == packet_timestamps_.end()) return 0;
return it.value();
}