It's waste of time to load external files. And it is not deterministic. Note we still allow to load single files by name, but it is not a big deal.
Unified · Split
| @@ -1212,6 +1212,18 @@ static void start_open(struct MPContext *mpctx, char *url, int url_flags, · 1211 unmodified lines | |||
| 1212 | mpctx->open_url_flags = url_flags; | 1212 | mpctx->open_url_flags = url_flags; |
| 1213 | mpctx->open_for_prefetch = for_prefetch && mpctx->opts->demuxer_thread; | 1213 | mpctx->open_for_prefetch = for_prefetch && mpctx->opts->demuxer_thread; |
| 1214 | 1214 | ||
| 1215 | #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION | ||
| 1216 | // Don't allow to open local paths or stdin during fuzzing | ||
| 1217 | bstr open_url = bstr0(mpctx->open_url); | ||
| 1218 | if (bstr_startswith0(open_url, "/") || | ||
| 1219 | bstr_startswith0(open_url, "./") || | ||
| 1220 | bstr_equals0(open_url, "-")) | ||
| 1221 | { | ||
| 1222 | cancel_open(mpctx); | ||
| 1223 | return; | ||
| 1224 | } | ||
| 1225 | #endif | ||
| 1226 | |||
| 1215 | if (mp_thread_create(&mpctx->open_thread, open_demux_thread, mpctx)) { | 1227 | if (mp_thread_create(&mpctx->open_thread, open_demux_thread, mpctx)) { |
| 1216 | cancel_open(mpctx); | 1228 | cancel_open(mpctx); |
| 1217 | return; | 1229 | return; |