Skip to content

Commit

Permalink
HLSReader: Only try to combine overlapping playlists if the diff is >= 0
Browse files Browse the repository at this point in the history
Otherwise `Inew += diff` results in going off the front of the array and a crash.

Refs #13488
Signed-off-by: Paul Harrison <pharrison@mythtv.org>
(cherry picked from commit a59a4f0)
  • Loading branch information
ijc authored and Paul Harrison committed Oct 5, 2019
1 parent 3e61fef commit a2ac6aa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/recorders/HLS/HLSReader.cpp
Expand Up @@ -564,7 +564,7 @@ bool HLSReader::ParseM3U8(const QByteArray& buffer, HLSRecStream* stream)
--Iseg;

int64_t diff = (*Iseg).Sequence() - (*Inew).Sequence();
if (new_segments.size() > diff)
if (diff >= 0 && new_segments.size() > diff)
{
Inew += diff;

Expand Down

0 comments on commit a2ac6aa

Please sign in to comment.