[mythtv-commits] [MythTV/mythtv] ce13a3: Fix "null pointer dereference" warning in DTVChann...

kmdewaal noreply at github.com
Thu Sep 24 21:43:51 UTC 2020

  Branch: refs/heads/master
  Home:   https://github.com/MythTV/mythtv
  Commit: ce13a3289d4101bb6fec28474c397980c5c6c1aa
  Author: Klaas de Waal <kdewaal at mythtv.org>
  Date:   2020-09-24 (Thu, 24 Sep 2020)

  Changed paths:
    M mythtv/libs/libmythtv/dtvconfparser.h

  Log Message:
  Fix "null pointer dereference" warning in DTVChannelInfo

Compiling the code with the "-O3" option gives warnings about "null pointer dereference"
for files that use the DTVChannelInfoList defined in dtvconfparser.h.
Although the correctness of the warning in this case can be discussed, it appears
that here the warning is caused by the mixing of Qt and C++ classes.
Note that DTVChannelInfo has a QString but DTVChannelInfoList is a std::vector.
Changing the QString into a std::string, so that only C++ classes are used, does remove the "null pointer dereference" warning.
Changing the std::vector to a QVector, so that only Qt classes are used, does also remove the warning.
Given that QVector but especially QString is used extensively in MythTV the DTVChannelInfoList has been changed into a QVector.
For consistency reasons the DTVChannelList, defined in the same file, has also been changed into a QVector.

More information about the mythtv-commits mailing list