summaryrefslogtreecommitdiff
path: root/core/src/fxge/win32
diff options
context:
space:
mode:
authorVitaly Buka <vitalybuka@chromium.org>2014-08-22 14:01:56 -0700
committerVitaly Buka <vitalybuka@chromium.org>2014-08-22 14:01:56 -0700
commite9bf0e918a731204f16cbd6e484f33190c10803e (patch)
tree93abf8b587ff284eb11b52c8ce00ca027d6dd5cc /core/src/fxge/win32
parentee6088e63bfdee81153ef1eeec9b90e42c87064f (diff)
downloadpdfium-e9bf0e918a731204f16cbd6e484f33190c10803e.tar.xz
Don't stretch bitmaps if destination size is empty.
BUG=405201 R=bo_xu@foxitsoftware.com Review URL: https://codereview.chromium.org/474093003
Diffstat (limited to 'core/src/fxge/win32')
-rw-r--r--core/src/fxge/win32/fx_win32_device.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/src/fxge/win32/fx_win32_device.cpp b/core/src/fxge/win32/fx_win32_device.cpp
index 5e76898db1..eee4fd8285 100644
--- a/core/src/fxge/win32/fx_win32_device.cpp
+++ b/core/src/fxge/win32/fx_win32_device.cpp
@@ -515,7 +515,7 @@ FX_BOOL CGdiDeviceDriver::GDI_StretchDIBits(const CFX_DIBitmap* pBitmap1, int de
int dest_width, int dest_height, FX_DWORD flags, void* pIccTransform)
{
CFX_DIBitmap* pBitmap = (CFX_DIBitmap*)pBitmap1;
- if (pBitmap == NULL) {
+ if (pBitmap == NULL || dest_width == 0 || dest_height == 0) {
return FALSE;
}
if ((pBitmap->IsCmykImage() || pIccTransform) &&
@@ -549,7 +549,7 @@ FX_BOOL CGdiDeviceDriver::GDI_StretchBitMask(const CFX_DIBitmap* pBitmap1, int d
int alpha_flag, void* pIccTransform)
{
CFX_DIBitmap* pBitmap = (CFX_DIBitmap*)pBitmap1;
- if (pBitmap == NULL) {
+ if (pBitmap == NULL || dest_width == 0 || dest_height == 0) {
return FALSE;
}
_Color2Argb(bitmap_color, bitmap_color, alpha_flag | (1 << 24), pIccTransform);