mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-05-13 23:34:16 +02:00
Fixed bug libsdl-org#6745 - Check for overflow in SDL_CalculateYUVSize (#6747)
Fixed bug #6745 - Check for overflow in SDL_CalculateYUVSize
This commit is contained in:
@@ -58,7 +58,10 @@ SDL_SW_CreateYUVTexture(Uint32 format, int w, int h)
|
||||
swdata->h = h;
|
||||
{
|
||||
size_t dst_size;
|
||||
SDL_CalculateYUVSize(format, w, h, &dst_size, NULL);
|
||||
if (SDL_CalculateYUVSize(format, w, h, &dst_size, NULL) < 0) {
|
||||
SDL_OutOfMemory();
|
||||
return NULL;
|
||||
}
|
||||
swdata->pixels = (Uint8 *)SDL_SIMDAlloc(dst_size);
|
||||
if (!swdata->pixels) {
|
||||
SDL_SW_DestroyYUVTexture(swdata);
|
||||
|
||||
Reference in New Issue
Block a user