Skip to content

Commit

Permalink
Avoid segfaulting with -v playback when m_positionMap is empty.
Browse files Browse the repository at this point in the history
  • Loading branch information
stichnot committed Feb 2, 2013
1 parent 17e935b commit 397d1e9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions mythtv/libs/libmythtv/decoderbase.cpp
Expand Up @@ -499,15 +499,18 @@ bool DecoderBase::FindPosition(long long desired_value, bool search_adjusted,

upper_bound = upper;
lower_bound = lower;
bool empty = m_positionMap.empty();

LOG(VB_PLAYBACK, LOG_INFO, LOC +
QString("FindPosition(%1, search%3 adjusted)")
.arg(desired_value).arg((search_adjusted) ? "" : " not") +
QString(" --> \n\t\t\t[%1:%2(%3),%4:%5(%6)]")
.arg(lower_bound).arg(GetKey(m_positionMap[lower_bound]))
.arg(lower_bound)
.arg(empty ? -1 : GetKey(m_positionMap[lower_bound]))
.arg(m_positionMap[lower_bound].pos)
.arg(upper_bound).arg(GetKey(m_positionMap[upper_bound]))
.arg(m_positionMap[upper_bound].pos));
.arg(upper_bound)
.arg(empty ? -1 : GetKey(m_positionMap[upper_bound]))
.arg(empty ? -1 : m_positionMap[upper_bound].pos));

return false;
}
Expand Down

0 comments on commit 397d1e9

Please sign in to comment.