From b87fc523cad03e6e9fe2019e4fdfed40f7699677 Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Thu, 26 Apr 2018 18:02:43 +0200 Subject: [PATCH] Fix CID 1386084 (Uninitialized scalar variable) The set_font method used the uninitialized member variable resolution_. Signed-off-by: Stefan Weil --- src/training/stringrenderer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/training/stringrenderer.cpp b/src/training/stringrenderer.cpp index 74fb004b35..2e4e9b5b96 100644 --- a/src/training/stringrenderer.cpp +++ b/src/training/stringrenderer.cpp @@ -90,7 +90,8 @@ Pix* CairoARGB32ToPixFormat(cairo_surface_t *surface) { StringRenderer::StringRenderer(const std::string& font_desc, int page_width, int page_height) - : page_width_(page_width), + : font_(font_desc), + page_width_(page_width), page_height_(page_height), h_margin_(50), v_margin_(50), @@ -118,7 +119,6 @@ StringRenderer::StringRenderer(const std::string& font_desc, int page_width, total_chars_(0), font_index_(0), last_offset_(0) { - set_font(font_desc); set_resolution(kDefaultOutputResolution); }