From ab9253796b32d097882428b816e5231c3404b835 Mon Sep 17 00:00:00 2001 From: chenyang322 Date: Tue, 5 Dec 2023 11:23:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DCVE-2023-6345?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: chenyang322 --- src/gpu/ops/DrawCustomMeshOp.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gpu/ops/DrawCustomMeshOp.cpp b/src/gpu/ops/DrawCustomMeshOp.cpp index 124a23b7..92962dab 100644 --- a/src/gpu/ops/DrawCustomMeshOp.cpp +++ b/src/gpu/ops/DrawCustomMeshOp.cpp @@ -779,10 +779,13 @@ GrOp::CombineResult CustomMeshOp::onCombineIfPossible(GrOp* t, SkArenaAlloc*, co return CombineResult::kCannotCombine; } + if (fVertexCount > INT32_MAX - that->fVertexCount) { + return CombineResult::kCannotCombine; + } if (SkToBool(fIndexCount) != SkToBool(that->fIndexCount)) { return CombineResult::kCannotCombine; } - if (SkToBool(fIndexCount) && fVertexCount + that->fVertexCount > SkToInt(UINT16_MAX)) { + if (SkToBool(fIndexCount) && fVertexCount > UINT16_MAX - that->fVertexCount) { return CombineResult::kCannotCombine; } -- Gitee