Bug 1429536 - Assure even width and hight for fake:true camera, fixing debug crash.
MozReview-Commit-ID: mxGcTFbEwe
--- a/dom/media/webrtc/MediaEngineDefault.cpp
+++ b/dom/media/webrtc/MediaEngineDefault.cpp
@@ -114,18 +114,18 @@ MediaEngineDefaultVideoSource::Allocate(
);
mOpts.mHeight = c.mHeight.Get(aPrefs.mHeight ? aPrefs.mHeight :
#ifdef DEBUG
MediaEngine::DEFAULT_43_VIDEO_HEIGHT/2
#else
MediaEngine::DEFAULT_43_VIDEO_HEIGHT
#endif
);
- mOpts.mWidth = std::max(160, std::min(mOpts.mWidth, 4096));
- mOpts.mHeight = std::max(90, std::min(mOpts.mHeight, 2160));
+ mOpts.mWidth = std::max(160, std::min(mOpts.mWidth, 4096)) & ~1;
+ mOpts.mHeight = std::max(90, std::min(mOpts.mHeight, 2160)) & ~1;
mState = kAllocated;
*aOutHandle = nullptr;
return NS_OK;
}
nsresult
MediaEngineDefaultVideoSource::Deallocate(AllocationHandle* aHandle)
{