Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2828)

Unified Diff: core/fxge/dib/fx_dib_engine.cpp

Issue 2240723002: Fix an integer overflow in CStretchEngine constructor (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « BUILD.gn ('k') | core/fxge/dib/fx_dib_engine_unittest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fxge/dib/fx_dib_engine.cpp
diff --git a/core/fxge/dib/fx_dib_engine.cpp b/core/fxge/dib/fx_dib_engine.cpp
index 520148fc7735d75ab2adcf5c147c72e0ef23133f..88b0d4b271632ce2b7f6aac696e68c34cf6d2ae0 100644
--- a/core/fxge/dib/fx_dib_engine.cpp
+++ b/core/fxge/dib/fx_dib_engine.cpp
@@ -306,8 +306,8 @@ CStretchEngine::CStretchEngine(IFX_ScanlineComposer* pDestBitmap,
FX_BOOL bInterpol =
flags & FXDIB_INTERPOL || flags & FXDIB_BICUBIC_INTERPOL;
if (!bInterpol && FXSYS_abs(dest_width) != 0 &&
- FXSYS_abs(dest_height) <
- m_SrcWidth * m_SrcHeight * 8 / FXSYS_abs(dest_width)) {
+ FXSYS_abs(dest_height) / 8 < static_cast<long long>(m_SrcWidth) *
+ m_SrcHeight / FXSYS_abs(dest_width)) {
flags = FXDIB_INTERPOL;
}
m_Flags = flags;
« no previous file with comments | « BUILD.gn ('k') | core/fxge/dib/fx_dib_engine_unittest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698