Skip to content
Permalink
Browse files

AvfDecoder: fix several Coverity detected errors

* 1026172 Uninitialized scalar variable (fill).
* 1026173 Uninitialized scalar variable (total).
* 1026164 Division or modulo by zero - this looks like a false positive
          because m_inited will be false if m_sampleFmt is FORMAT_NONE
          which is the only way the division by 0 can happen.
  • Loading branch information
Paul Harrison
Paul Harrison committed May 31, 2013
1 parent 5c45e91 commit 4a572fb12b92c33bd24181d6b52cb6e56fe8e1c8
Showing with 12 additions and 2 deletions.
  1. +12 −2 mythplugins/mythmusic/mythmusic/avfdecoder.cpp
@@ -471,9 +471,19 @@ void avfDecoder::run()

AVPacket pkt, tmp_pkt;
int data_size;
uint fill, total;
uint fill = 0, total = 0;

// sanity check sampleSize
// should never get here unless m_sampleFmt is good but check just in case
int sampleSize = AudioOutputSettings::SampleSize(m_sampleFmt);
if (sampleSize == 0)
{
RunEpilog();
return;
}

// account for possible frame expansion in aobase (upmix, float conv)
uint thresh = m_bks * 12 / AudioOutputSettings::SampleSize(m_sampleFmt);
uint thresh = m_bks * 12 / sampleSize;

m_stat = DecoderEvent::Decoding;
{

0 comments on commit 4a572fb

Please sign in to comment.
You can’t perform that action at this time.