Skip to content

Commit df51058

Browse files
committed
Dont access bg->entries[index] if oob
1 parent ac7c858 commit df51058

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/backend_wgpu.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -712,9 +712,9 @@ static inline uint64_t bgEntryHashRD(const ResourceDescriptor bge) {
712712
}
713713

714714
void UpdateBindGroupEntry(DescribedBindGroup *bg, size_t index, ResourceDescriptor entry) {
715-
if (index >= bg->entryCount) {
715+
if (bg->entries == NULL || index >= bg->entryCount) {
716716
TRACELOG(LOG_WARNING, "Trying to set entry %d on a BindGroup with only %d entries", (int)index, (int)bg->entryCount);
717-
// return;
717+
return;
718718
}
719719
WGPUBuffer newpuffer = entry.buffer;
720720
WGPUTextureView newtexture = entry.textureView;

0 commit comments

Comments
 (0)