Skip to content

Commit fc91202

Browse files
authored
chore: cherry-pick 5361d836ae from chromium (#34009)
1 parent 6aa0609 commit fc91202

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

patches/chromium/.patches

+1
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ skia_renderer_-_don_t_explicitly_clip_scissor_for_large_transforms.patch
175175
skia_renderer_use_rectf_intersect_in_applyscissor.patch
176176
cherry-pick-1a31e2110440.patch
177177
m100_change_ownership_of_blobbytesprovider.patch
178+
m96-lts_add_bounds_check_to_webgpudecoderimpl_dorequestdevice.patch
178179
cherry-pick-5ff02e4d7368.patch
179180
cherry-pick-12ba78f3fa7a.patch
180181
reland_fix_noopener_case_for_user_activation_consumption.patch
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2+
From: Austin Eng <enga@chromium.org>
3+
Date: Mon, 25 Apr 2022 21:01:40 +0000
4+
Subject: Add bounds check to WebGPUDecoderImpl::DoRequestDevice
5+
6+
(cherry picked from commit bee4701c99cbbbb25c0bd6c5c79a40f63f1b1e47)
7+
8+
Fixed: chromium:1314754
9+
Change-Id: Id23af9cc3df08cca3ce7d627e3761c9a65a2c802
10+
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3580555
11+
Commit-Queue: Austin Eng <enga@chromium.org>
12+
Cr-Original-Commit-Position: refs/heads/main@{#991510}
13+
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3589810
14+
Reviewed-by: Achuith Bhandarkar <achuith@chromium.org>
15+
Owners-Override: Achuith Bhandarkar <achuith@chromium.org>
16+
Commit-Queue: Roger Felipe Zanoni da Silva <rzanoni@google.com>
17+
Cr-Commit-Position: refs/branch-heads/4664@{#1603}
18+
Cr-Branched-From: 24dc4ee75e01a29d390d43c9c264372a169273a7-refs/heads/main@{#929512}
19+
20+
diff --git a/gpu/command_buffer/service/webgpu_decoder_impl.cc b/gpu/command_buffer/service/webgpu_decoder_impl.cc
21+
index 703dd4c1aee81aa8b05733b91d1de05b87ff1c0b..507595e2bb5d47128fc6e08dbadf21c43d36cdf0 100644
22+
--- a/gpu/command_buffer/service/webgpu_decoder_impl.cc
23+
+++ b/gpu/command_buffer/service/webgpu_decoder_impl.cc
24+
@@ -582,13 +582,13 @@ error::Error WebGPUDecoderImpl::InitDawnDevice(
25+
uint32_t device_generation,
26+
const WGPUDeviceProperties& request_device_properties,
27+
bool* creation_succeeded) {
28+
- DCHECK_LE(0, requested_adapter_index);
29+
-
30+
- DCHECK_LT(static_cast<size_t>(requested_adapter_index),
31+
- dawn_adapters_.size());
32+
-
33+
*creation_succeeded = false;
34+
35+
+ if (requested_adapter_index < 0 ||
36+
+ static_cast<uint32_t>(requested_adapter_index) >= dawn_adapters_.size()) {
37+
+ return error::kOutOfBounds;
38+
+ }
39+
+
40+
dawn_native::DeviceDescriptor device_descriptor;
41+
if (request_device_properties.textureCompressionBC) {
42+
device_descriptor.requiredExtensions.push_back("texture_compression_bc");

0 commit comments

Comments
 (0)