mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-26 12:27:44 +00:00
GPU: Validate that buffer size is at least 4 bytes
This commit is contained in:
@@ -1340,6 +1340,12 @@ SDL_GPUBuffer *SDL_CreateGPUBuffer(
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (device->debug_mode) {
|
||||
if (createinfo->size < 4) {
|
||||
SDL_assert_release(!"Cannot create a buffer with size less than 4 bytes!");
|
||||
}
|
||||
}
|
||||
|
||||
const char *debugName = SDL_GetStringProperty(createinfo->props, SDL_PROP_GPU_BUFFER_CREATE_NAME_STRING, NULL);
|
||||
|
||||
return device->CreateBuffer(
|
||||
|
||||
Reference in New Issue
Block a user