Browse files

Fix false positive coverity report

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 06b28fe453fe7cb543e26dccb1cfbf31b6ab7336
Showing with 1 addition and 1 deletion.
  1. +1 −1 mythtv/libs/libmythtv/avformatwriter.cpp
@@ -42,7 +42,6 @@ AVFormatWriter::AVFormatWriter()
: FileWriterBase(),
m_avfRingBuffer(NULL), m_ringBuffer(NULL),
m_videoStream(NULL), m_avVideoCodec(NULL),
m_audioStream(NULL), m_avAudioCodec(NULL),
@@ -52,6 +51,7 @@ AVFormatWriter::AVFormatWriter()
memset(&m_fmt, 0, sizeof(m_fmt));

0 comments on commit 06b28fe

Please sign in to comment.