Fix CID 1164666 (Uninitialized scalar field)

Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
Stefan Weil 2019-09-15 22:01:25 +02:00
parent fc6899d898
commit 91b3248af3
2 changed files with 12 additions and 15 deletions

View File

@ -198,10 +198,8 @@ TabVector* TabVector::FitVector(TabAlignment alignment, ICOORD vertical,
TabVector::TabVector(const TabVector& src, TabAlignment alignment,
const ICOORD& vertical_skew, BLOBNBOX* blob)
: extended_ymin_(src.extended_ymin_), extended_ymax_(src.extended_ymax_),
sort_key_(0), percent_score_(0), mean_width_(0),
needs_refit_(true), needs_evaluation_(true), intersects_other_lines_(false),
alignment_(alignment),
top_constraints_(nullptr), bottom_constraints_(nullptr) {
needs_refit_(true), needs_evaluation_(true),
alignment_(alignment) {
BLOBNBOX_C_IT it(&boxes_);
it.add_to_end(blob);
TBOX box = blob->bounding_box();

View File

@ -2,7 +2,6 @@
// File: tabvector.h
// Description: Class to hold a near-vertical vector representing a tab-stop.
// Author: Ray Smith
// Created: Thu Apr 10 16:25:01 PST 2008
//
// (C) Copyright 2008, Google Inc.
// Licensed under the Apache License, Version 2.0 (the "License");
@ -398,21 +397,21 @@ class TabVector : public ELIST2_LINK {
// The top of the tab line.
ICOORD endpt_;
// The lowest y that the vector might extend to.
int extended_ymin_;
int extended_ymin_ = 0;
// The highest y that the vector might extend to.
int extended_ymax_;
int extended_ymax_ = 0;
// Perpendicular distance of vector from a given vertical for sorting.
int sort_key_;
int sort_key_ = 0;
// Result of Evaluate 0-100. Coverage of line with good boxes.
int percent_score_;
int percent_score_ = 0;
// The mean width of the blobs. Meaningful only for separator lines.
int mean_width_;
int mean_width_ = 0;
// True if the boxes_ list has been modified, so a refit is needed.
bool needs_refit_;
bool needs_refit_ = false;
// True if a fit has been done, so re-evaluation is needed.
bool needs_evaluation_;
bool needs_evaluation_ = false;
// True if a separator line intersects at least 2 other lines.
bool intersects_other_lines_;
bool intersects_other_lines_ = false;
// The type of this TabVector.
TabAlignment alignment_;
// The list of boxes whose edges are aligned at this TabVector.
@ -421,8 +420,8 @@ class TabVector : public ELIST2_LINK {
TabVector_CLIST partners_;
// Constraints used to resolve the exact location of the top and bottom
// of the tab line.
TabConstraint_LIST* top_constraints_;
TabConstraint_LIST* bottom_constraints_;
TabConstraint_LIST* top_constraints_ = nullptr;
TabConstraint_LIST* bottom_constraints_ = nullptr;
};
} // namespace tesseract.