summaryrefslogtreecommitdiff
path: root/core/fxge/dib/cfx_dibitmap.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/fxge/dib/cfx_dibitmap.cpp')
-rw-r--r--core/fxge/dib/cfx_dibitmap.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/fxge/dib/cfx_dibitmap.cpp b/core/fxge/dib/cfx_dibitmap.cpp
index 857ca9a3ce..a9764e7550 100644
--- a/core/fxge/dib/cfx_dibitmap.cpp
+++ b/core/fxge/dib/cfx_dibitmap.cpp
@@ -819,7 +819,10 @@ bool CFX_DIBitmap::CalculatePitchAndSize(int height,
if (width <= 0 || height <= 0)
return false;
- if ((INT_MAX - 31) / width < (format & 0xFF))
+ if (!(format & 0xff))
+ return false;
+
+ if ((INT_MAX - 31) / width < (format & 0xff))
return false;
if (!*pitch)