[mythtv] regression with 7f00642b

Gary Buhrmaster gary.buhrmaster at gmail.com
Tue May 15 00:48:00 UTC 2018


On Sat, May 12, 2018 at 12:17 AM, Jean-Yves Avenard <jyavenard at gmail.com> wrote:

> As it's called with length set to 0, it is fine.

Based on your far greater c++ expertise, the follow
is the next (final?) proposed patch:


{{{
diff --git a/mythtv/libs/libmythtv/mpeg/mpegtables.cpp
b/mythtv/libs/libmythtv/mpeg/mpegtables.cpp
index 3120b821f6..e61a699075 100644
--- a/mythtv/libs/libmythtv/mpeg/mpegtables.cpp
+++ b/mythtv/libs/libmythtv/mpeg/mpegtables.cpp
@@ -445,7 +445,7 @@ ProgramMapTable* ProgramMapTable::Create(
         uint len = global_desc[i][1] + 2;
         gdesc.insert(gdesc.end(), global_desc[i], global_desc[i] + len);
     }
-    pmt->SetProgramInfo(&gdesc[0], gdesc.size());
+    pmt->SetProgramInfo(gdesc.data(), gdesc.size());

     for (uint i = 0; i < count; i++)
     {
@@ -457,7 +457,7 @@ ProgramMapTable* ProgramMapTable::Create(
                          prog_desc[i][j], prog_desc[i][j] + len);
         }

-        pmt->AppendStream(pids[i], types[i], &pdesc[0], pdesc.size());
+        pmt->AppendStream(pids[i], types[i], pdesc.data(), pdesc.size());
     }
     pmt->Finalize();

}}}


And while it is not strictly necessary, I would
also propose this patch, in order to avoid
a potential future static analysis warnings:

{{{
diff --git a/mythtv/libs/libmythbase/mythsocket.cpp
b/mythtv/libs/libmythbase/mythsocket.cpp
index bed0172cad..66a2d3f675 100644
--- a/mythtv/libs/libmythbase/mythsocket.cpp
+++ b/mythtv/libs/libmythbase/mythsocket.cpp
@@ -1006,7 +1006,7 @@ void MythSocket::ResetReal(void)
         if (avail)
         {
             trash.resize(max((uint)trash.size(),avail));
-            m_tcpSocket->read(&trash[0], avail);
+            m_tcpSocket->read(trash.data(), avail);
         }

         LOG(VB_NETWORK, LOG_INFO, LOC + "Reset() " +
}}}



I have been running my BE and FE with these patches
and they seem to work for me.


More information about the mythtv-dev mailing list