Skip to content

Commit 113be2c

Browse files
null77mibrunin
authored andcommitted
[Backport] CVE-2021-30559: Out of bounds write in ANGLE
Manual cherry-pick of patch originally reviewed on https://chromium-review.googlesource.com/c/angle/angle/+/2961070: D3D11: Fix OOB write in Blit11. This could happen for specific values of the 'dest' target. Bug: chromium:1219082 Change-Id: Ic19a5dc4a95531f9513403ad9c97a4b4c5dc5a6f Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Michal Klocek <michal.klocek@qt.io> (cherry picked from commit dcd69a3) Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
1 parent b547d6a commit 113be2c

File tree

1 file changed

+3
-2
lines changed
  • chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11

1 file changed

+3
-2
lines changed

chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/Blit11.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,13 @@ void StretchedBlitNearest_RowByRow(const gl::Box &sourceArea,
6060
uint8_t *destData)
6161
{
6262
int srcHeightSubOne = (sourceArea.height - 1);
63-
size_t copySize = pixelSize * destArea.width;
63+
size_t copySize = pixelSize * clippedDestArea.width;
6464
size_t srcOffset = sourceArea.x * pixelSize;
65-
size_t destOffset = destArea.x * pixelSize;
65+
size_t destOffset = clippedDestArea.x * pixelSize;
6666

6767
for (int y = clippedDestArea.y; y < clippedDestArea.y + clippedDestArea.height; y++)
6868
{
69+
// TODO: Fix divide by zero when height == 1. http://anglebug.com/6099
6970
float yPerc = static_cast<float>(y - destArea.y) / (destArea.height - 1);
7071

7172
// Interpolate using the original source rectangle to determine which row to sample from

0 commit comments

Comments
 (0)