Skip to content

Commit

Permalink
Fix false positive coverity report
Browse files Browse the repository at this point in the history
C++ standard:
-8- An object whose initializer is an empty set of parentheses, i.e.,
   (), shall be value-initialized.

-5- To value-initialize an object of type T means:
   -- if T is a non-union class type without a user-provided
      constructor, then every non-static data member and base-class
      component of T is value-initialized;93)

   93) Value-initialization for such a class object may be
       implemented by zero-initializing the object and then calling
       the default constructor.

   -- if T is an array type, then each element is value-initialized;

   -- otherwise, the object is zero-initialized

hence, m_fmt is zero initialised by the default constructor.

And regardless, m_fmt would have been set during AVFormatWriter::Init() which is always called.

Coverity-Id: 609723
  • Loading branch information
jyavenard committed Jun 21, 2013
1 parent 8c31549 commit 06b28fe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/avformatwriter.cpp
Expand Up @@ -42,7 +42,6 @@ AVFormatWriter::AVFormatWriter()
: FileWriterBase(),

m_avfRingBuffer(NULL), m_ringBuffer(NULL),

m_ctx(NULL),
m_videoStream(NULL), m_avVideoCodec(NULL),
m_audioStream(NULL), m_avAudioCodec(NULL),
Expand All @@ -52,6 +51,7 @@ AVFormatWriter::AVFormatWriter()
{
av_register_all();
avcodec_register_all();
memset(&m_fmt, 0, sizeof(m_fmt));
}

AVFormatWriter::~AVFormatWriter()
Expand Down

0 comments on commit 06b28fe

Please sign in to comment.