[mythtv-commits] [MythTV/mythtv] 094e0d: tidy: Fix memory leak in HLSSegment::DecodeData.

linuxdude42 noreply at github.com
Tue Mar 26 17:11:11 UTC 2019


  Branch: refs/heads/fixes/30
  Home:   https://github.com/MythTV/mythtv
  Commit: 094e0d0c8038dac291dc4634e268c5fdc9dc0502
      https://github.com/MythTV/mythtv/commit/094e0d0c8038dac291dc4634e268c5fdc9dc0502
  Author: David Hampton <mythtv at love2code.net>
  Date:   2019-03-26 (Tue, 26 Mar 2019)

  Changed paths:
    M mythtv/libs/libmythtv/HLS/httplivestreambuffer.cpp

  Log Message:
  -----------
  tidy: Fix memory leak in HLSSegment::DecodeData.

The clang-tidy "memory leak" checker pointed out that
HLSSegment::DecodeData function would leak memory if it read an
invalid padding size from the end of the buffer.  Add a line to free
the temporary buffer in this error condition.

Fixes #13435.

(cherry picked from commit 221e867bcbf5a79ff5f68eb5d30aa78538a2dbfb)


  Commit: ff4c7158f4fb241760e77fad7c2a8eef1a4eb5c3
      https://github.com/MythTV/mythtv/commit/ff4c7158f4fb241760e77fad7c2a8eef1a4eb5c3
  Author: David Hampton <mythtv at love2code.net>
  Date:   2019-03-26 (Tue, 26 Mar 2019)

  Changed paths:
    M mythtv/libs/libmythtv/cc708decoder.cpp

  Log Message:
  -----------
  tidy: Fix rare null pointer dereference in cc707decoder.cpp.

The clang-tidy "non-null parameter checker" pointed out to possibility
of the cc708 decoder dereferencing through a null pointer.  This code
starts with a default buffer size of 512 and then attempts to allocate
a larger buffer when necessary (in this case, if a single subtitle is
more than 512 characters.)  If the reallocation fails, the code would
end up storing the nullptr error return into the buffer pointer, and
then dereference it an an attempt to store the new characters.  Catch
this rare condition and drop the characters that won't fit into the
existing buffer.

Fixes #13436.

(cherry picked from commit d0356aba3c9394200a86dcab7d1cf17a558c5eab)


  Commit: 0999fd0ff08d21bf7873daf78fe9e453925cd83d
      https://github.com/MythTV/mythtv/commit/0999fd0ff08d21bf7873daf78fe9e453925cd83d
  Author: David Hampton <mythtv at love2code.net>
  Date:   2019-03-26 (Tue, 26 Mar 2019)

  Changed paths:
    M mythtv/libs/libmythmetadata/metaioflacvorbis.cpp

  Log Message:
  -----------
  tidy: Fix test to retrieve picture from FLAC file.

The clang-tidy "call and message" check pointed out the inevitability
of calling a function through a nullptr.  The getPictureFromFile
function was testing the wrong variable when determining whether or
not a picture was the requested type.  While there, make a variable
'auto' to tighten up the code.

Fixes #13437.

(cherry picked from commit 6a21dd100e453d24437e980ef01c5525a53efbc1)


  Commit: 3af3cad3d74735a561ab594910a3400b2472645c
      https://github.com/MythTV/mythtv/commit/3af3cad3d74735a561ab594910a3400b2472645c
  Author: David Hampton <mythtv at love2code.net>
  Date:   2019-03-26 (Tue, 26 Mar 2019)

  Changed paths:
    M mythtv/libs/libmythtv/recorders/recorderbase.cpp

  Log Message:
  -----------
  tidy: Fix memory leak in HLSSegment::DecodeData.

The clang-tidy "memory leak" checker pointed out that the
RecorderBase::CheckForRingBufferSwitch function would leak the memory
pointed to by the 'recq' variable if the 'm_tvrec' variable contains
nullptr.  Add a line to free the memory pointed to by the 'recq'
variable in this case.

Fixes #13438.

(cherry picked from commit e6a39281b112fb03ef2f804c13bc6ebe9d336c90)


Compare: https://github.com/MythTV/mythtv/compare/81081957a0cb...3af3cad3d747


More information about the mythtv-commits mailing list