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>
This commit is contained in:
Peter Wu 2015-10-04 12:45:21 +02:00 committed by Gerald Combs
parent 076d07d9fa
commit 89b227f44e
1 changed files with 1 additions and 1 deletions

View File

@ -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();
}