diff options
author | Lei Zhang <thestig@chromium.org> | 2015-11-09 14:47:16 -0800 |
---|---|---|
committer | Lei Zhang <thestig@chromium.org> | 2015-11-09 14:47:16 -0800 |
commit | 6d9979dc685e3b67b0a6d9946376e026d75d3e47 (patch) | |
tree | f9b95bb83cd889913546da6be5000e4b2d811aad /core/src/fpdfapi/fpdf_render | |
parent | 3388f907ecac9e7662bca3bbfdf35721ded19f26 (diff) | |
download | pdfium-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.cpp | 8 |
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; |