diff --git a/gfx/tests/crashtests/1762973-1.html b/gfx/tests/crashtests/1762973-1.html new file mode 100644 index 000000000000..6f8935211d0e --- /dev/null +++ b/gfx/tests/crashtests/1762973-1.html @@ -0,0 +1,29 @@ + + + + +
+ + +
    diff --git a/gfx/tests/crashtests/crashtests.list b/gfx/tests/crashtests/crashtests.list index 70b60055f939..e675466ddb1d 100644 --- a/gfx/tests/crashtests/crashtests.list +++ b/gfx/tests/crashtests/crashtests.list @@ -211,3 +211,4 @@ load 1730695.html load 1745775.html load 1757002.html load 1758127-1.html +load 1762973-1.html diff --git a/gfx/wr/swgl/src/composite.h b/gfx/wr/swgl/src/composite.h index 55d36609db71..4caf80446b4e 100644 --- a/gfx/wr/swgl/src/composite.h +++ b/gfx/wr/swgl/src/composite.h @@ -435,6 +435,10 @@ void Composite(LockedTexture* lockedDst, LockedTexture* lockedSrc, GLint srcX, IntRect{srcX, srcY, srcX + srcWidth, srcY + srcHeight} - srctex.offset; IntRect dstReq = IntRect{dstX, dstY, dstX + dstWidth, dstY + dstHeight} - dsttex.offset; + if (srcReq.is_empty() || dstReq.is_empty()) { + return; + } + // Compute clip rect as relative to the dstReq, as that's the same coords // as used for the sampling bounds. IntRect clipRect = {clipX - dstX, clipY - dstY, clipX - dstX + clipWidth, @@ -1230,6 +1234,10 @@ void CompositeYUV(LockedTexture* lockedDst, LockedTexture* lockedY, IntRect{srcX, srcY, srcX + srcWidth, srcY + srcHeight} - ytex.offset; IntRect dstReq = IntRect{dstX, dstY, dstX + dstWidth, dstY + dstHeight} - dsttex.offset; + if (srcReq.is_empty() || dstReq.is_empty()) { + return; + } + // Compute clip rect as relative to the dstReq, as that's the same coords // as used for the sampling bounds. IntRect clipRect = {clipX - dstX, clipY - dstY, clipX - dstX + clipWidth,