Skip to content

Commit

Permalink
Patch for (potential) uninitalized variable num_lines
Browse files Browse the repository at this point in the history
Static analysis indicates that there is a feasible
code path in LayoutParagraphs (called in GetNarrowWidth)
which will not result in calling Layout which will
initialize the variable num_lines.  Initialize the
variable num_lines just in case (and make the
analyzer happy).
(cherry picked from commit a5388fb)

Signed-off-by: Stuart Morgan <smorgan@mythtv.org>

Fixes #11553
  • Loading branch information
garybuhrmaster authored and stuartm committed Jun 4, 2013
1 parent 63687f8 commit b1d6e4b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mythtv/libs/libmythui/mythuitext.cpp
Expand Up @@ -612,7 +612,8 @@ bool MythUIText::GetNarrowWidth(const QStringList & paragraphs,
{
qreal height, last_line_width, lines;
int best_width, too_narrow, last_width = -1;
int num_lines, line_height = 0;
int num_lines = 0;
int line_height = 0;
int attempt = 0;
Qt::TextElideMode cutdown = m_Cutdown;
m_Cutdown = Qt::ElideNone;
Expand Down

0 comments on commit b1d6e4b

Please sign in to comment.