mirror of
https://github.com/mpv-player/mpv
synced 2024-12-11 09:25:56 +00:00
demux_mkv: don't crash on tracks with unknown audio codecs
Demuxers can't remove streams anymore after adding them, so the free_sh_audio() call caused a crash.
This commit is contained in:
parent
fae7307931
commit
ed2c54cea9
@ -1542,7 +1542,6 @@ static int demux_mkv_open_audio(demuxer_t *demuxer, mkv_track_t *track,
|
||||
mp_tmsg(MSGT_DEMUX, MSGL_WARN, "[mkv] Unknown/unsupported audio "
|
||||
"codec ID '%s' for track %u or missing/faulty\n[mkv] "
|
||||
"private codec data.\n", track->codec_id, track->tnum);
|
||||
free_sh_audio(demuxer, track->id);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -400,7 +400,7 @@ sh_audio_t *new_sh_audio_aid(demuxer_t *demuxer, int id, int aid)
|
||||
return demuxer->a_streams[id];
|
||||
}
|
||||
|
||||
void free_sh_audio(demuxer_t *demuxer, int id)
|
||||
static void free_sh_audio(demuxer_t *demuxer, int id)
|
||||
{
|
||||
sh_audio_t *sh = demuxer->a_streams[id];
|
||||
demuxer->a_streams[id] = NULL;
|
||||
@ -429,7 +429,7 @@ sh_video_t *new_sh_video_vid(demuxer_t *demuxer, int id, int vid)
|
||||
return demuxer->v_streams[id];
|
||||
}
|
||||
|
||||
void free_sh_video(sh_video_t *sh)
|
||||
static void free_sh_video(sh_video_t *sh)
|
||||
{
|
||||
mp_msg(MSGT_DEMUXER, MSGL_DBG2, "DEMUXER: freeing sh_video at %p\n", sh);
|
||||
free(sh->bih);
|
||||
|
@ -184,8 +184,6 @@ struct sh_video *new_sh_video_vid(struct demuxer *demuxer, int id, int vid);
|
||||
struct sh_sub *new_sh_sub_sid(struct demuxer *demuxer, int id, int sid);
|
||||
struct sh_sub *new_sh_sub_sid_lang(struct demuxer *demuxer, int id, int sid,
|
||||
const char *lang);
|
||||
void free_sh_audio(struct demuxer *demuxer, int id);
|
||||
void free_sh_video(struct sh_video *sh);
|
||||
|
||||
const char *sh_sub_type2str(int type);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user