summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGavin Hurlbut <ghurlbut@mythtv.org>2010-11-18 05:00:48 (GMT)
committer Gavin Hurlbut <ghurlbut@mythtv.org>2010-11-18 05:00:48 (GMT)
commitbde9ee332b12f2bf25e3217fbdd1b598669a9866 (patch)
treeb5e68bf75d75bfbf41bd30b06478cd964c01cf1d
parent24f8fcfac0bfb7bb5d1614d1d9f9aed9f9c467c9 (diff)
Fixes a "read 4 bytes before allocated block of 28 bytes" error found by
valgrind. With a reverse_iterator, check that we haven't hit end() before checking the value of the iterator as on the last check, the value is not actually in the list. git-svn-id: http://svn.mythtv.org/svn/trunk@27271 7dbf422c-18fa-0310-86e9-fd20926502f2
-rw-r--r--mythtv/libs/libmyth/audiooutputsettings.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/mythtv/libs/libmyth/audiooutputsettings.cpp b/mythtv/libs/libmyth/audiooutputsettings.cpp
index 5b2d3ee..2578d26 100644
--- a/mythtv/libs/libmyth/audiooutputsettings.cpp
+++ b/mythtv/libs/libmyth/audiooutputsettings.cpp
@@ -239,7 +239,7 @@ void AudioOutputSettings::SetBestSupportedChannels(int channels)
vector<int>::reverse_iterator it;
for (it = m_channels.rbegin();
- *it >= channels && it < m_channels.rend();
+ it != m_channels.rend() && *it >= channels;
it++)
m_channels.pop_back();
m_channels.push_back(channels);