Skip to content

randomizer: do not pass NULL to memcpy()

Romain Vimont requested to merge rom1v/vlc:randomizer_fix into master

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

Loading