-
-
Notifications
You must be signed in to change notification settings - Fork 418
Description
Please confirm the following points:
- This report is NOT about the Android apps in the Play Store
- I have searched the project page to check if the issue was already reported
Affected Project
libprojectM (including the playlist library)
Affected Version
4.1.4
Operating Systems and Architectures
All
Build Tools
No response
Additional Project, OS and Toolset Details
Hi,
I've noticed a small issue in Playlist.cpp, in
auto Playlist::NextPresetIndex() -> uint32_t
When shuffle mode is active, the position can be defined beyond the last item as randomDistribution determines a number between the min & max value, inclusive of them.
So instead of
std::uniform_int_distribution<uint32_t> randomDistribution(0, static_cast<uint32_t>(m_items.size()));
I think it should rather be
std::uniform_int_distribution<uint32_t> randomDistribution(0, static_cast<uint32_t>(m_items.size()-1));
Type of Defect
Specific bug in projectM code (please link the code in question)
Log Output
Describe the Issue
when randomDistribution determines a too high position, the call to projectm_playlist_play_next wont do anything.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status