提交 65088615 authored 作者: José Luis Millán's avatar José Luis Millán

#196. Fix crash in Consumer::getStats()

Scenario:

`Consumer::RemoveProfile()` is called with the profile pointed by `targetProfile`.
The corresponding entry is erased from `mapProfileRtpStream` container.

`targetProfile` is not being cleared, and here resides the bug.

Few RTP packets later a packet with the profile pointed by `targetProfile` comes
in `SendRtpPacket()`. We were waiting for it, so we make such profile the
`effectiveProfile`. At this point `effectiveProfile` points to a profile which
is not present in `mapProfileRtpStream` and this crash will happen on the next
call to `GetStats()`.
上级 d0e7aa0c
......@@ -334,6 +334,10 @@ namespace RTC
{
SetEffectiveProfile(RtpEncodingParameters::Profile::NONE);
}
else if (this->targetProfile == profile)
{
this->targetProfile = this->effectiveProfile;
}
RecalculateTargetProfile();
}
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论