Skip to content

Commit 7eb931b

Browse files
author
Michal Klocek
committed
[Backport] CVE-2023-6345: Integer overflow in Skia
Cherry-pick of patch originally reviewed on https://skia-review.googlesource.com/c/skia/+/782936: Avoid combining extremely large meshes. Bug: chromium:1505053 Fixes: QTBUG-120589 Change-Id: I42f2ff872bbf054686ec7af0cc85ff63055fcfbf Reviewed-on: https://codereview.qt-project.org/c/qt/qtwebengine-chromium/+/528729 Reviewed-by: Michael Brüning <[email protected]>
1 parent ae7c52f commit 7eb931b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

chromium/third_party/skia/src/gpu/ops/GrDrawVerticesOp.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,11 @@ GrOp::CombineResult DrawVerticesOp::onCombineIfPossible(GrOp* t, GrRecordingCont
757757
return CombineResult::kCannotCombine;
758758
}
759759

760-
if (fVertexCount + that->fVertexCount > SkTo<int>(UINT16_MAX)) {
760+
if (fVertexCount > INT32_MAX - that->fVertexCount) {
761+
return CombineResult::kCannotCombine;
762+
}
763+
764+
if (fVertexCount > SkTo<int>(UINT16_MAX) - that->fVertexCount) {
761765
return CombineResult::kCannotCombine;
762766
}
763767

0 commit comments

Comments
 (0)