From 28ff3ee6aa34d1386f61c9277feaa41ec8c919ee Mon Sep 17 00:00:00 2001 From: "fischman@webrtc.org" Date: Fri, 16 Aug 2013 19:12:26 +0000 Subject: [PATCH] Fix invalid cricket::SrtpStat::FailureKey::operator<() implementation. If operator<(a, b) returns true, then it must not be the case that operator<(b, a) is true as well, but the old implementation would do exactly that if a={1, 0, 0} and b={0, 0, 1}, for example. Should fix e.g.: [004:555] Error(unittest_main.cc:40): c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xtree(1746) : Assertion failed: invalid operator< from http://chromegw/i/client.libjingle/builders/Win32%20Debug/builds/245/steps/libjingle_p2p_unittest/logs/stdio R=juberti@webrtc.org, mallinath@webrtc.org Review URL: https://webrtc-codereview.appspot.com/2054005 git-svn-id: http://webrtc.googlecode.com/svn/trunk@4561 4adac7df-926f-26a2-2b94-8c16560cd09d --- talk/session/media/srtpfilter.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/talk/session/media/srtpfilter.h b/talk/session/media/srtpfilter.h index 9b48dcd957..b6a269952a 100644 --- a/talk/session/media/srtpfilter.h +++ b/talk/session/media/srtpfilter.h @@ -271,7 +271,10 @@ class SrtpStat { error(in_error) { } bool operator <(const FailureKey& key) const { - return ssrc < key.ssrc || mode < key.mode || error < key.error; + return + (ssrc < key.ssrc) || + (ssrc == key.ssrc && mode < key.mode) || + (ssrc == key.ssrc && mode == key.mode && error < key.error); } uint32 ssrc; SrtpFilter::Mode mode;