From e96bffe7a820a149dc5d2ea212c75a7d9a0c305c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= Date: Fri, 1 Nov 2024 13:56:28 +0100 Subject: [PATCH] player/loadfile: limit playlist size to 10 for fuzzing Fixes timeout on huge generated playlists, 10 is enough to test if it works. --- player/loadfile.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/player/loadfile.c b/player/loadfile.c index c71f82ba45..7a6c8a6091 100644 --- a/player/loadfile.c +++ b/player/loadfile.c @@ -1564,6 +1564,11 @@ static void play_current_file(struct MPContext *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; assert(mpctx->playing); assert(mpctx->playing->filename);