Avoid divide by 0 error

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

// FREEBIE
pull/1/head
Michael Kirk 7 years ago
parent 3864880a6f
commit 4c797151e6

@ -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",

Loading…
Cancel
Save