REVIEWED: Possible overflow #4206

This commit is contained in:
Ray 2024-08-04 22:08:38 +02:00
parent b657001e0d
commit 923f983719
2 changed files with 4 additions and 2 deletions

View File

@ -4993,7 +4993,8 @@ static int rlGetPixelDataSize(int width, int height, int format)
default: break;
}
dataSize = width*height*bpp/8; // Total data size in bytes
char bytesPerPixel = bpp/8;
dataSize = width*height*bytesPerPixel; // Total data size in bytes
// Most compressed formats works on 4x4 blocks,
// if texture is smaller, minimum dataSize is 8 or 16

View File

@ -5403,7 +5403,8 @@ int GetPixelDataSize(int width, int height, int format)
default: break;
}
dataSize = width*height*bpp/8; // Total data size in bytes
char bytesPerPixel = bpp/8;
dataSize = width*height*bytesPerPixel; // Total data size in bytes
// Most compressed formats works on 4x4 blocks,
// if texture is smaller, minimum dataSize is 8 or 16