REVIEWED: possible overflow... again #4206
This commit is contained in:
parent
923f983719
commit
9c2ba3bfb7
2 changed files with 4 additions and 4 deletions
|
@ -4993,8 +4993,8 @@ static int rlGetPixelDataSize(int width, int height, int format)
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
|
|
||||||
char bytesPerPixel = bpp/8;
|
float bytesPerPixel = (float)bpp/8.0f;
|
||||||
dataSize = width*height*bytesPerPixel; // Total data size in bytes
|
dataSize = (int)(bytesPerPixel*width*height); // Total data size in bytes
|
||||||
|
|
||||||
// Most compressed formats works on 4x4 blocks,
|
// Most compressed formats works on 4x4 blocks,
|
||||||
// if texture is smaller, minimum dataSize is 8 or 16
|
// if texture is smaller, minimum dataSize is 8 or 16
|
||||||
|
|
|
@ -5403,8 +5403,8 @@ int GetPixelDataSize(int width, int height, int format)
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
|
|
||||||
char bytesPerPixel = bpp/8;
|
float bytesPerPixel = (float)bpp/8.0f;
|
||||||
dataSize = width*height*bytesPerPixel; // Total data size in bytes
|
dataSize = (int)(bytesPerPixel*width*height); // Total data size in bytes
|
||||||
|
|
||||||
// Most compressed formats works on 4x4 blocks,
|
// Most compressed formats works on 4x4 blocks,
|
||||||
// if texture is smaller, minimum dataSize is 8 or 16
|
// if texture is smaller, minimum dataSize is 8 or 16
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue