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

Unified Diff: core/src/fxge/win32/fx_win32_device.cpp

Issue 474093003: Don't stretch bitmaps if destination size is empty. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Thu 08/21/2014 18:47:28.76 Created 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fxge/win32/fx_win32_device.cpp
diff --git a/core/src/fxge/win32/fx_win32_device.cpp b/core/src/fxge/win32/fx_win32_device.cpp
index 5e76898db138656b796a4ddc809b9a19c6ea42b3..eee4fd82857471425ebd5ef65f3b1e78bb0f3c7a 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);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698