video/decode/vd_lavc: fix null deref when hwdec is empty

This can happen when using --hwdec-clr.

Fixes: 9ff8c9e780
This commit is contained in:
nanahi 2024-09-29 15:01:51 -04:00 committed by sfan5
parent 151fa74806
commit ffb40ab958
1 changed files with 1 additions and 1 deletions

View File

@ -481,7 +481,7 @@ static void select_and_set_hwdec(struct mp_filter *vd)
add_all_hwdec_methods(&hwdecs, &num_hwdecs);
char **hwdec_api = ctx->opts->hwdec_api;
for (int i = 0; hwdec_api[i]; i++) {
for (int i = 0; hwdec_api && hwdec_api[i]; i++) {
bstr opt = bstr0(hwdec_api[i]);
bool hwdec_requested = !bstr_equals0(opt, "no");