mirror of
https://github.com/mpv-player/mpv.git
synced 2026-10-24 04:05:46 +08:00
demux_mkv: check that subtitle type is set before accessing it
Fixes crashes in case of unknown subtitle track being found, as
the original ARIB caption logic added in 0da0acdae8
did not attempt to take into mention tracks with unknown type.
Fixes #13106
This commit is contained in:
+1
-1
@@ -1962,7 +1962,7 @@ static int demux_mkv_open_sub(demuxer_t *demuxer, mkv_track_t *track)
|
||||
sh->codec->extradata = track->private_data;
|
||||
sh->codec->extradata_size = track->private_size;
|
||||
|
||||
if (!strcmp(sh->codec->codec, "arib_caption") && track->private_size >= 3) {
|
||||
if (subtitle_type && !strcmp(sh->codec->codec, "arib_caption") && track->private_size >= 3) {
|
||||
struct AVCodecParameters **lavp = talloc_ptrtype(track, lavp);
|
||||
|
||||
talloc_set_destructor(lavp, avcodec_par_destructor);
|
||||
|
||||
Reference in New Issue
Block a user