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

Issue 432543002: Fix integer overflow when stretching bitmap for printing (Closed)

Created:
6 years, 4 months ago by Bo Xu
Modified:
6 years, 4 months ago
CC:
pdfium-reviews_googlegroups.com
Base URL:
https://pdfium.googlesource.com/pdfium.git@master
Visibility:
Public.

Description

Fix integer overflow when stretch bitmap When an image object is zoomed in by a big factor, the scaling factor in the transformation matrix is big as well, resulting in a large |dest_width| and |dest_height| value(they can be think of as the equivalent pixel size of the entire image, although most of it is outside the device). BUG=395636 R=vitalybuka@chromium.org Committed: https://pdfium.googlesource.com/pdfium/+/2fd400c

Patch Set 1 #

Total comments: 2

Patch Set 2 : Use long long #

Total comments: 4

Patch Set 3 : Use FX_INT64 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+2 lines, -2 lines) Patch
M core/src/fxge/win32/fx_win32_device.cpp View 1 2 2 chunks +2 lines, -2 lines 0 comments Download

Messages

Total messages: 9 (0 generated)
Bo Xu
6 years, 4 months ago (2014-07-30 21:14:20 UTC) #1
Vitaly Buka (NO REVIEWS)
https://codereview.chromium.org/432543002/diff/1/core/src/fxge/win32/fx_win32_device.cpp File core/src/fxge/win32/fx_win32_device.cpp (right): https://codereview.chromium.org/432543002/diff/1/core/src/fxge/win32/fx_win32_device.cpp#newcode534 core/src/fxge/win32/fx_win32_device.cpp:534: if (m_DeviceClass == FXDC_PRINTER && (pBitmap->GetWidth()/abs(dest_width) > abs(dest_height)/pBitmap->GetHeight())) { ...
6 years, 4 months ago (2014-07-30 21:24:43 UTC) #2
Vitaly Buka (NO REVIEWS)
On 2014/07/30 21:24:43, Vitaly Buka wrote: > https://codereview.chromium.org/432543002/diff/1/core/src/fxge/win32/fx_win32_device.cpp > File core/src/fxge/win32/fx_win32_device.cpp (right): > > https://codereview.chromium.org/432543002/diff/1/core/src/fxge/win32/fx_win32_device.cpp#newcode534 ...
6 years, 4 months ago (2014-07-30 21:27:27 UTC) #3
Bo Xu
On 2014/07/30 21:27:27, Vitaly Buka wrote: > On 2014/07/30 21:24:43, Vitaly Buka wrote: > > ...
6 years, 4 months ago (2014-07-30 23:35:51 UTC) #4
Vitaly Buka (NO REVIEWS)
lgtm https://codereview.chromium.org/432543002/diff/1/core/src/fxge/win32/fx_win32_device.cpp File core/src/fxge/win32/fx_win32_device.cpp (right): https://codereview.chromium.org/432543002/diff/1/core/src/fxge/win32/fx_win32_device.cpp#newcode526 core/src/fxge/win32/fx_win32_device.cpp:526: if (abs(dest_width) * abs(dest_height) < pBitmap1->GetWidth() * pBitmap1->GetHeight() ...
6 years, 4 months ago (2014-07-31 00:00:07 UTC) #5
Bo Xu
https://codereview.chromium.org/432543002/diff/20001/core/src/fxge/win32/fx_win32_device.cpp File core/src/fxge/win32/fx_win32_device.cpp (right): https://codereview.chromium.org/432543002/diff/20001/core/src/fxge/win32/fx_win32_device.cpp#newcode525 core/src/fxge/win32/fx_win32_device.cpp:525: CFX_ByteString info = CFX_WindowsDIB::GetBitmapInfo(pBitmap); On 2014/07/31 00:00:06, Vitaly Buka ...
6 years, 4 months ago (2014-07-31 16:51:11 UTC) #6
Bo Xu
Committed patchset #3 manually as r2fd400c (presubmit successful).
6 years, 4 months ago (2014-07-31 16:56:18 UTC) #7
Nico
(nit: Please wrap your CL descriptions to about 80 columns, as `git log` doesn't do ...
6 years, 4 months ago (2014-07-31 17:02:03 UTC) #8
Bo Xu
6 years, 4 months ago (2014-07-31 17:03:26 UTC) #9
Message was sent while issue was closed.
On 2014/07/31 17:02:03, Nico (away) wrote:
> (nit: Please wrap your CL descriptions to about 80 columns, as `git log`
doesn't
> do any wrapping on its own)

Thanks, will do.

Powered by Google App Engine
This is Rietveld 408576698