From b73970e94fe7fa55ad91370e24cb3d041e159ae6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fl=C3=B6ssie?= Date: Mon, 1 Jan 2018 13:04:01 +0100 Subject: [PATCH] Fix unintended sign extent (Coverity) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Would hit us at 716Mpx (26755px²). --- rtengine/rawimage.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rtengine/rawimage.cc b/rtengine/rawimage.cc index de392623d..8d7292113 100644 --- a/rtengine/rawimage.cc +++ b/rtengine/rawimage.cc @@ -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(height) * static_cast(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(height) * static_cast(width)]; data = new float*[height]; for (int i = 0; i < height; i++) {