Re: [Opalvoip-devel] Endless loop in OpalMediaFormat::GetMatchingRegisteredMediaFormats()
Brought to you by:
csoutheren,
rjongbloed
From: Robert J. <ro...@vo...> - 2010-02-22 06:45:11
|
Patch applied, thanks! Robert Jongbloed OPAL/OpenH323/PTLib Architect and Co-founder. > -----Original Message----- > From: Vyacheslav Frolov [mailto:v.f...@or...] > Sent: Thursday, 18 February 2010 2:58 AM > To: Robert Jongbloed; opa...@li... > Subject: Endless loop in OpalMediaFormat::GetMatchingRegisteredMediaFormats() > > At least for Linux: > > registeredFormats.FindFormat(rtpPayloadType, clockRate, rtpEncodingName, > protocol, registeredFormats.end()) > > is equivalent to > > registeredFormats.FindFormat(rtpPayloadType, clockRate, rtpEncodingName, > protocol) > > So we get the endless loop. > > Here is a patch: > > ------------------------------------------------------------------ > Index: src/opal/mediafmt.cxx > =================================================================== > --- src/opal/mediafmt.cxx (revision 24066) > +++ src/opal/mediafmt.cxx (working copy) > @@ -860,9 +860,14 @@ > const OpalMediaFormatList & registeredFormats = GetMediaFormatsList(); > for (OpalMediaFormatList::const_iterator format = > registeredFormats.FindFormat(rtpPayloadType, clockRate, rtpEncodingName, > protocol); > format != registeredFormats.end(); > - format = registeredFormats.FindFormat(rtpPayloadType, clockRate, > rtpEncodingName, protocol, ++format)) > + format = registeredFormats.FindFormat(rtpPayloadType, clockRate, > rtpEncodingName, protocol, format)) > + { > matches += *format; > > + if (++format == registeredFormats.end()) > + break; > + } > + > return matches; > } > > ------------------------------------------------------------------ > > > **************************************************************************** * > ************************** > This message and any attachments (the "message") are confidential and > intended solely for the addressees. > Any unauthorised use or dissemination is prohibited. > Messages are susceptible to alteration. Orange Business Services shall not be > liable for the message if altered, changed or > falsified. If you are not the intended addressee of this message, please > cancel it immediately and inform > the sender. > **************************************************************************** * > ************************** |