summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrbpotter <rbpotter@chromium.org>2017-10-19 17:29:53 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-10-20 00:47:19 +0000
commitd0b48fa54263ac6d5bdd3d7ffadfb7010b9c77da (patch)
tree1408377260f58d6e881966b390012cbe045ff4f3
parentabd3bfb29fc26210fe1723bc63bf3c7b6dac9856 (diff)
downloadpdfium-d0b48fa54263ac6d5bdd3d7ffadfb7010b9c77da.tar.xz
PostScript: Do not send fonts with size <= 0 to printerschromium/3246
Bug: chromium:767343 Change-Id: I9321e7565feb423a1283c74e91297eeaeb80083f Reviewed-on: https://pdfium-review.googlesource.com/16410 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Rebekah Potter <rbpotter@chromium.org>
-rw-r--r--core/fxge/win32/cfx_psrenderer.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/core/fxge/win32/cfx_psrenderer.cpp b/core/fxge/win32/cfx_psrenderer.cpp
index d97391822a..ecfab49c38 100644
--- a/core/fxge/win32/cfx_psrenderer.cpp
+++ b/core/fxge/win32/cfx_psrenderer.cpp
@@ -644,16 +644,20 @@ bool CFX_PSRenderer::DrawText(int nChars,
const CFX_Matrix* pObject2Device,
float font_size,
uint32_t color) {
- StartRendering();
- int alpha = FXARGB_A(color);
- if (alpha < 255)
- return false;
+ // Do not send zero or negative font sizes to printers. See crbug.com/767343.
+ if (font_size <= 0.0)
+ return true;
if ((pObject2Device->a == 0 && pObject2Device->b == 0) ||
(pObject2Device->c == 0 && pObject2Device->d == 0)) {
return true;
}
+ StartRendering();
+ int alpha = FXARGB_A(color);
+ if (alpha < 255)
+ return false;
+
SetColor(color);
std::ostringstream buf;
buf << "q[" << pObject2Device->a << " " << pObject2Device->b << " "