[GPU]: Prevent out-of-bounds access in VisitImageView
This commit is contained in:
parent
ea4672b4a8
commit
dbb990c971
2 changed files with 3 additions and 4 deletions
|
|
@ -1,6 +1,3 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
|
|
|
|||
|
|
@ -498,7 +498,9 @@ template <class P>
|
|||
ImageViewId TextureCache<P>::VisitImageView(DescriptorTable<TICEntry>& table,
|
||||
std::span<ImageViewId> cached_image_view_ids,
|
||||
u32 index) {
|
||||
if (index > table.Limit()) {
|
||||
const u32 limit = table.Limit();
|
||||
const size_t cache_size = cached_image_view_ids.size();
|
||||
if (index > limit || index >= cache_size) {
|
||||
LOG_DEBUG(HW_GPU, "Invalid image view index={}", index);
|
||||
return NULL_IMAGE_VIEW_ID;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue