Commit e3988722 by Shahbaz Youssefi Committed by Commit Bot

Fix an OOB access bug with RewriteRowMajorMatrices

Bug: angleproject:2273 Change-Id: I27109b873a290133cf3d016f612e1fd1de9d354c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2341763Reviewed-by: 's avatarShahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
parent e26c5e07
...@@ -261,7 +261,10 @@ class TransformArrayHelper ...@@ -261,7 +261,10 @@ class TransformArrayHelper
// The last value is unused, and is not present. // The last value is unused, and is not present.
TVector<unsigned int> accumulatedArraySizes(arraySizes.size() - 1); TVector<unsigned int> accumulatedArraySizes(arraySizes.size() - 1);
accumulatedArraySizes[0] = arraySizes[0]; if (accumulatedArraySizes.size() > 0)
{
accumulatedArraySizes[0] = arraySizes[0];
}
for (size_t index = 1; index + 1 < arraySizes.size(); ++index) for (size_t index = 1; index + 1 < arraySizes.size(); ++index)
{ {
accumulatedArraySizes[index] = accumulatedArraySizes[index - 1] * arraySizes[index]; accumulatedArraySizes[index] = accumulatedArraySizes[index - 1] * arraySizes[index];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment