summaryrefslogtreecommitdiffstats
path: root/player/loadfile.c
diff options
context:
space:
mode:
authorrcombs <rcombs@rcombs.me>2021-05-26 17:56:59 -0500
committersfan5 <sfan5@live.de>2023-06-25 11:01:58 +0200
commitbe34f52f721176b288b8705f63e7ec15f65acc3b (patch)
tree9c08ae89a4b44371bb6e428567dbe87d23a56238 /player/loadfile.c
parent57dae8f42c0f08a1cf26ea71adb9a3fc5cef4cc1 (diff)
downloadmpv-be34f52f721176b288b8705f63e7ec15f65acc3b.tar.bz2
mpv-be34f52f721176b288b8705f63e7ec15f65acc3b.tar.xz
loadfile: short-circuit early on null stream language
Diffstat (limited to 'player/loadfile.c')
-rw-r--r--player/loadfile.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/player/loadfile.c b/player/loadfile.c
index f08e51f9d5..ca1510817b 100644
--- a/player/loadfile.c
+++ b/player/loadfile.c
@@ -444,6 +444,8 @@ void add_demuxer_tracks(struct MPContext *mpctx, struct demuxer *demuxer)
// Result numerically higher => better match. 0 == no match.
static int match_lang(char **langs, char *lang)
{
+ if (!lang)
+ return 0;
for (int idx = 0; langs && langs[idx]; idx++) {
if (lang && strcasecmp(langs[idx], lang) == 0)
return INT_MAX - idx;