History

player/sub: check order before using it as an index

Kacper Michajłow committed 1 year ago

Commit 6496de41 parent 401939b1 file · +4 −2Browse files

Unified · Split

player/sub.c+4−2
@@ -76,9 +76,11 @@ void uninit_sub(struct MPContext *mpctx, struct track *track) · 75 unmodified lines
7676 if (track && track->d_sub) {
7777 int order = get_order(mpctx, track);
7878 reset_subtitles(mpctx, track);
79− term_osd_set_subs(mpctx, NULL, order);
8079 sub_select(track->d_sub, false);
81− osd_set_sub(mpctx->osd, order, NULL);
80+ if (order >= 0) {
81+ term_osd_set_subs(mpctx, NULL, order);
82+ osd_set_sub(mpctx->osd, order, NULL);
83+ }
8284 sub_destroy(track->d_sub);
8385 track->d_sub = NULL;
8486 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t