fix(Camera): test video definition in notifyReceivedVideoSize, can be null if receiver disconnects at first frame received

This commit is contained in:
Ronan Abhamon 2018-02-05 11:07:49 +01:00
parent a5291ce836
commit 8a84a26cfa

View file

@ -156,6 +156,11 @@ void CameraRenderer::updateWindowId () {
bool CameraRenderer::notifyReceivedVideoSize () const {
shared_ptr<const linphone::VideoDefinition> videoDefinition = mCall->getCurrentParams()->getReceivedVideoDefinition();
// Can be null if the receiver quickly disconnects. Rare but possible.
if (!videoDefinition)
return false;
unsigned int width = videoDefinition->getWidth();
unsigned int height = videoDefinition->getHeight();