Avoid divide by 0 error

Didn't actually see this in the wild - just being defensive.

// FREEBIE
This commit is contained in:
Michael Kirk 2017-10-05 12:14:25 -04:00
parent 3864880a6f
commit 4c797151e6
1 changed files with 5 additions and 0 deletions

View File

@ -152,6 +152,11 @@ NS_ASSUME_NONNULL_BEGIN
- (void)videoView:(RTCEAGLVideoView *)videoView didChangeVideoSize:(CGSize)remoteVideoSize
{
AssertIsOnMainThread();
if (remoteVideoSize.height <= 0) {
OWSFail(@"Illegal video height: %f", remoteVideoSize.height);
return;
}
CGFloat aspectRatio = remoteVideoSize.width / remoteVideoSize.height;
DDLogVerbose(@"%@ Remote video size: width: %f height: %f ratio: %f",