mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1025343: fix issues with overlong codec names in AudioConduit r=pkerr
This commit is contained in:
parent
f398cfeee3
commit
06a8193337
@ -853,15 +853,15 @@ bool
|
||||
WebrtcAudioConduit::CodecConfigToWebRTCCodec(const AudioCodecConfig* codecInfo,
|
||||
webrtc::CodecInst& cinst)
|
||||
{
|
||||
const unsigned int plNameLength = codecInfo->mName.length()+1;
|
||||
const unsigned int plNameLength = codecInfo->mName.length();
|
||||
memset(&cinst, 0, sizeof(webrtc::CodecInst));
|
||||
if(sizeof(cinst.plname) < plNameLength)
|
||||
if(sizeof(cinst.plname) < plNameLength+1)
|
||||
{
|
||||
CSFLogError(logTag, "%s Payload name buffer capacity mismatch ",
|
||||
__FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
memcpy(cinst.plname, codecInfo->mName.c_str(),codecInfo->mName.length());
|
||||
memcpy(cinst.plname, codecInfo->mName.c_str(), plNameLength);
|
||||
cinst.plname[plNameLength]='\0';
|
||||
cinst.pltype = codecInfo->mType;
|
||||
cinst.rate = codecInfo->mRate;
|
||||
|
Loading…
Reference in New Issue
Block a user