summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi/fpdf_render
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2015-11-09 14:47:16 -0800
committerLei Zhang <thestig@chromium.org>2015-11-09 14:47:16 -0800
commit6d9979dc685e3b67b0a6d9946376e026d75d3e47 (patch)
treef9b95bb83cd889913546da6be5000e4b2d811aad /core/src/fpdfapi/fpdf_render
parent3388f907ecac9e7662bca3bbfdf35721ded19f26 (diff)
downloadpdfium-6d9979dc685e3b67b0a6d9946376e026d75d3e47.tar.xz
Fix a leak in CPDF_Type3Font::LoadChar().
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1408063016 .
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;