randomizer: do not pass NULL to memcpy()
When switching playback order from NORMAL to RANDOM, the current playlist items are added to the randomizer.
However, if the playlist is empty, the items vector is empty, and its `.data field is NULL. This causes the following error in ASAN:
../../src/playlist/randomizer.c:426:10: runtime error: null pointer passed as argument 2, which is declared to never be null
If the playlist size is 0, then do not call randomizer_Add()
at all.
Merge request reports
Activity
changed milestone to %4.0
- Resolved by Rémi Denis-Courmont
I prefer the check on the outside of
randomizer_Add
and the addition of an assert/unreachable inrandomizer_Add
given that adding zero items doesn't seem like a legit use case.
added MRStatus::Acceptable label
added MRStatus::InReview label and removed MRStatus::Acceptable label
added MRStatus::Acceptable label and removed MRStatus::InReview label
added MRStatus::Accepted label and removed MRStatus::Acceptable label
MR Acceptance result
This MergeRequest has been Accepted! Congratulations.MR acceptance checks details:
-
MR should be considered mergeable by Gitlab -
Last pipeline should be successful -
MergeRequest should have at least one external review and/or vote -
All threads should be resolved, and score >= 0 -
MergeRequest should have no activity (threads/votes) for (24h/24h)
-
added 61 commits
-
4ba3fae5...46e9fb37 - 59 commits from branch
videolan:master
- 279758e3 - randomizer: do not pass NULL to memcpy()
- 5ebf9e28 - vlc_vector: assert count argument is not 0
-
4ba3fae5...46e9fb37 - 59 commits from branch