diff --git a/mythtv/libs/libmythtv/recorders/HLS/HLSReader.cpp b/mythtv/libs/libmythtv/recorders/HLS/HLSReader.cpp index 98d9db0c81f..1890d30e010 100644 --- a/mythtv/libs/libmythtv/recorders/HLS/HLSReader.cpp +++ b/mythtv/libs/libmythtv/recorders/HLS/HLSReader.cpp @@ -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;