mirror of
https://github.com/mpv-player/mpv.git
synced 2025-12-22 10:57:08 +00:00
player/sub: avoid indexing arrays with -1
This commit is contained in:
@@ -138,7 +138,9 @@ static bool update_subtitle(struct MPContext *mpctx, double video_pts,
|
||||
// Handle displaying subtitles on terminal.
|
||||
if (track->selected && track->type == STREAM_SUB && !mpctx->video_out) {
|
||||
char *text = sub_get_text(dec_sub, video_pts, SD_TEXT_TYPE_PLAIN);
|
||||
term_osd_set_subs(mpctx, text, get_order(mpctx, track));
|
||||
int order = get_order(mpctx, track);
|
||||
if (order >= 0)
|
||||
term_osd_set_subs(mpctx, text, order);
|
||||
talloc_free(text);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user