Don't stretch bitmaps if destination size is empty. BUG=405201 R=bo_xu@foxitsoftware.com Review URL: https://codereview.chromium.org/474093003
diff --git a/core/src/fxge/win32/fx_win32_device.cpp b/core/src/fxge/win32/fx_win32_device.cpp index 5e76898..eee4fd8 100644 --- a/core/src/fxge/win32/fx_win32_device.cpp +++ b/core/src/fxge/win32/fx_win32_device.cpp
@@ -515,7 +515,7 @@ 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 @@ 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);