Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kodi crashes if segment isn't within the current timeshift buffer window #975

Open
6 tasks
glennguy opened this issue May 12, 2022 · 3 comments
Open
6 tasks
Labels
Issue Type: Bug issue has reported a bug v20 Nexus

Comments

@glennguy
Copy link
Contributor

Bug report

Describe the bug

Here is a clear and concise description of what the problem is:

As per the title

Expected Behavior

Here is a clear and concise description of what was expected to happen:

No crash

Actual Behavior

Crash

Possible Fix

To Reproduce

Steps to reproduce the behavior:

  1. Run this stream:
#KODIPROP:inputstream=inputstream.adaptive
#KODIPROP:inputstream.adaptive.manifest_type=hls
https://cph-p2p-msl.akamaized.net/hls/live/2000341/test/master.m3u8
  1. Pause for a few minutes or so
  2. Resume playback
  3. inputstream.adaptive crashes - vector subscript out of range

Debuglog

The debuglog can be found here:
Not needed - place of crash detailed below

MPD/M3U8s/ISM

An example or copy of a manifest (or manifests for HLS - master and variants) can be found here:
As above

Screenshots

Here are some links or screenshots to help explain the problem:

Additional context or screenshots (if appropriate)

Here is some additional context or explanation that might help:

nextSegment = current_rep_->get_segment(
static_cast<size_t>(segment_buffers_[0].segment_number - current_rep_->startNumber_));

After pausing for some time, segment 0 remains the same while the tree (i.e the representation) continues to be updated in the background. Once playback resumes, Kodi wants to read more data and ensureSegment enters the above code. Due to playlist/rep refreshes, start_number_ has been continually incrementing in the background. The expression underflows and get_segment is given a number well outside the bounds of segments_ causing the exception.

Your Environment

Used Operating system:

  • Android

  • iOS

  • tvOS

  • Linux

  • OSX

  • [ x] Windows

  • Windows UWP

  • Operating system version/name:

  • Kodi version: 20 - 2022-05-09

  • inputstream.adaptive version: 20.2.0

note: Once the issue is made we require you to update it with new information should that be required.
Team Kodi will consider your problem report however, we will not make any promises the problem will be solved.

@glennguy glennguy added Issue Type: Bug issue has reported a bug v20 Nexus labels May 12, 2022
@basilgello
Copy link
Contributor

Then the fix for crash itself is not let the expression underflow? I.e assume 0 if it's negative?

@glennguy
Copy link
Contributor Author

Probably. This code path is new since the adaptive rework and just wanted to find time to understand properly before jumping in.

@CastagnaIT
Copy link
Collaborator

i have tested but looks like that this has been already fixed on Kodi 21
at least im not able to reproduce it

if you can confirm you can close the issue
no one will take care to fix the obsolete code of nexus branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue Type: Bug issue has reported a bug v20 Nexus
Projects
None yet
Development

No branches or pull requests

3 participants