commit 7b1f82c392e85781e278dc68d62210f67125333e
parent 1a23e1d76bfb36cb104ce137b009ce7eadb27987
Author: Andreas Pehrson <apehrson@mozilla.com>
Date: Thu, 2 Oct 2025 18:46:28 +0000
Bug 1991494 - Restrict dimensions calculation to int32_t rather than assert bounds. r=jib
Differential Revision: https://phabricator.services.mozilla.com/D266765
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dom/media/webrtc/MediaEngineRemoteVideoSource.cpp b/dom/media/webrtc/MediaEngineRemoteVideoSource.cpp
@@ -155,9 +155,9 @@ static gfx::IntSize CalculateDesiredSize(DesiredSizeInput aInput) {
double scale = std::min(
{scale_width, scale_height, scale_width_strict, scale_height_strict});
- dst_width = AssertedCast<int32_t>(
+ dst_width = SaturatingCast<int32_t>(
std::round(scale * AssertedCast<double>(inputWidth)));
- dst_height = AssertedCast<int32_t>(
+ dst_height = SaturatingCast<int32_t>(
std::round(scale * AssertedCast<double>(inputHeight)));
}