summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi/fpdf_render
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2015-11-09 14:51:57 -0800
committerLei Zhang <thestig@chromium.org>2015-11-09 14:51:57 -0800
commit956168fc8abf4046e94eef9ee76b0705a6248ac0 (patch)
tree967273d93f252c7db794ad3484e02d40e8b2e843 /core/src/fpdfapi/fpdf_render
parentb155293cd514587c4c392d3ffebe2dfb5a765bd3 (diff)
downloadpdfium-956168fc8abf4046e94eef9ee76b0705a6248ac0.tar.xz
Merge to XFA: Fix a leak in CPDF_Type3Font::LoadChar().
TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1408063016 . (cherry picked from commit 6d9979dc685e3b67b0a6d9946376e026d75d3e47) Review URL: https://codereview.chromium.org/1418503020 .
Diffstat (limited to 'core/src/fpdfapi/fpdf_render')
-rw-r--r--core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp
index 89ac8ac143..c8d86e072d 100644
--- a/core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp
+++ b/core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp
@@ -128,10 +128,10 @@ CFX_GlyphBitmap* CPDF_Type3Cache::RenderGlyph(CPDF_Type3Glyphs* pSize,
const CFX_AffineMatrix* pMatrix,
FX_FLOAT retinaScaleX,
FX_FLOAT retinaScaleY) {
- CPDF_Type3Char* pChar = m_pFont->LoadChar(charcode);
- if (pChar == NULL || pChar->m_pBitmap == NULL) {
- return NULL;
- }
+ const CPDF_Type3Char* pChar = m_pFont->LoadChar(charcode);
+ if (!pChar || !pChar->m_pBitmap)
+ return nullptr;
+
CFX_DIBitmap* pBitmap = pChar->m_pBitmap;
CFX_AffineMatrix image_matrix, text_matrix;
image_matrix = pChar->m_ImageMatrix;