Fix unintended sign extent (Coverity)

Would hit us at 716Mpx (26755px²).
This commit is contained in:
Flössie
2018-01-01 13:04:01 +01:00
parent 820b6c8ae9
commit b73970e94f

View File

@@ -695,7 +695,7 @@ float** RawImage::compress_image(int frameNum, bool freeImage)
} else if (colors == 1) {
// Monochrome
if (!allocation) {
allocation = new float[height * width];
allocation = new float[static_cast<unsigned long>(height) * static_cast<unsigned long>(width)];
data = new float*[height];
for (int i = 0; i < height; i++) {
@@ -704,7 +704,7 @@ float** RawImage::compress_image(int frameNum, bool freeImage)
}
} else {
if (!allocation) {
allocation = new float[3 * height * width];
allocation = new float[3UL * static_cast<unsigned long>(height) * static_cast<unsigned long>(width)];
data = new float*[height];
for (int i = 0; i < height; i++) {