Skip to content
Browse files

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: 7dbf422c-18fa-0310-86e9-fd20926502f2
  • Loading branch information...
1 parent 24f8fcf commit bde9ee332b12f2bf25e3217fbdd1b598669a9866 @Beirdo Beirdo committed Nov 18, 2010
Showing with 1 addition and 1 deletion.
  1. +1 −1 mythtv/libs/libmyth/audiooutputsettings.cpp
2 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;

0 comments on commit bde9ee3

Please sign in to comment.
Something went wrong with that request. Please try again.