diff --git a/gfx/layers/d3d11/CompositorD3D11.cpp b/gfx/layers/d3d11/CompositorD3D11.cpp index 793fb245a780..aaa12dfc122e 100644 --- a/gfx/layers/d3d11/CompositorD3D11.cpp +++ b/gfx/layers/d3d11/CompositorD3D11.cpp @@ -466,7 +466,11 @@ CompositorD3D11::CreateRenderTargetFromSource(const gfx::IntRect &aRect, const IntSize& srcSize = sourceD3D11->GetSize(); MOZ_ASSERT(srcSize.width >= 0 && srcSize.height >= 0, "render targets should have nonnegative sizes"); - if (srcBox.right <= static_cast(srcSize.width) && + if (srcBox.left >= 0 && + srcBox.top >= 0 && + srcBox.left < srcBox.right && + srcBox.top < srcBox.bottom && + srcBox.right <= static_cast(srcSize.width) && srcBox.bottom <= static_cast(srcSize.height)) { mContext->CopySubresourceRegion(texture, 0, 0, 0, 0,