Commit cb4fdac4 authored by Max Kellermann's avatar Max Kellermann

playlist/cue/parser: fix nullptr dereference

parent ac46a843
...@@ -3,7 +3,7 @@ ver 0.22.1 (not yet released) ...@@ -3,7 +3,7 @@ ver 0.22.1 (not yet released)
- alsa: don't deadlock when the ALSA driver is buggy - alsa: don't deadlock when the ALSA driver is buggy
- jack, pulse: reduce the delay when stopping or pausing playback - jack, pulse: reduce the delay when stopping or pausing playback
* playlist * playlist
- cue: fix crash bug - cue: fix two crash bugs
ver 0.22 (2020/09/23) ver 0.22 (2020/09/23)
* protocol * protocol
......
...@@ -262,7 +262,9 @@ CueParser::Feed2(char *p) noexcept ...@@ -262,7 +262,9 @@ CueParser::Feed2(char *p) noexcept
if (previous != nullptr && previous->GetStartTime().ToMS() < (unsigned)position_ms) if (previous != nullptr && previous->GetStartTime().ToMS() < (unsigned)position_ms)
previous->SetEndTime(SongTime::FromMS(position_ms)); previous->SetEndTime(SongTime::FromMS(position_ms));
current->SetStartTime(SongTime::FromMS(position_ms)); if (current != nullptr)
current->SetStartTime(SongTime::FromMS(position_ms));
if(strcmp(nr, "00") != 0 || previous == nullptr) if(strcmp(nr, "00") != 0 || previous == nullptr)
ignore_index = true; ignore_index = true;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment