protocol/ArgParser: cast seek offset to SignedSongTime

"The issue is that ParseCommandArgSignedSongTime parses with
SongTime::FromS, not SignedSongTime::FromS, before casting back to a
SignedSongTime for the return. With x86 overflow rules this doesn't
matter, but on ARM the first cast turns negative values to zero."

Closes https://github.com/MusicPlayerDaemon/MPD/issues/757
This commit is contained in:
Max Kellermann
2020-02-10 09:18:37 +01:00
parent 42eb69f46f
commit 5397d18ed9
2 changed files with 2 additions and 1 deletions

View File

@@ -175,5 +175,5 @@ SignedSongTime
ParseCommandArgSignedSongTime(const char *s)
{
auto value = ParseCommandArgFloat(s);
return SongTime::FromS(value);
return SignedSongTime::FromS(value);
}