player/loadfile: limit playlist size to 10 for fuzzing

Fixes timeout on huge generated playlists, 10 is enough to test if it
works.
This commit is contained in:
Kacper Michajłow 2024-11-01 13:56:28 +01:00
parent 0a5d656c20
commit e96bffe7a8
1 changed files with 5 additions and 0 deletions

View File

@ -1564,6 +1564,11 @@ static void play_current_file(struct MPContext *mpctx)
reset_playback_state(mpctx); reset_playback_state(mpctx);
#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
if (mpctx->playlist->num_entries > 10)
goto terminate_playback;
#endif
mpctx->playing = mpctx->playlist->current; mpctx->playing = mpctx->playlist->current;
assert(mpctx->playing); assert(mpctx->playing);
assert(mpctx->playing->filename); assert(mpctx->playing->filename);