Skip to content

Commit b87fc52

Browse files
committed
Fix CID 1386084 (Uninitialized scalar variable)
The set_font method used the uninitialized member variable resolution_. Signed-off-by: Stefan Weil <[email protected]>
1 parent e2135de commit b87fc52

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/training/stringrenderer.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ Pix* CairoARGB32ToPixFormat(cairo_surface_t *surface) {
9090

9191
StringRenderer::StringRenderer(const std::string& font_desc, int page_width,
9292
int page_height)
93-
: page_width_(page_width),
93+
: font_(font_desc),
94+
page_width_(page_width),
9495
page_height_(page_height),
9596
h_margin_(50),
9697
v_margin_(50),
@@ -118,7 +119,6 @@ StringRenderer::StringRenderer(const std::string& font_desc, int page_width,
118119
total_chars_(0),
119120
font_index_(0),
120121
last_offset_(0) {
121-
set_font(font_desc);
122122
set_resolution(kDefaultOutputResolution);
123123
}
124124

0 commit comments

Comments
 (0)