mirror of https://github.com/mpv-player/mpv
dec_sub: avoid segfault on sub_init_decoder failure
Broken by commit 687b552d
.
Signed-off-by: wm4 <wm4@nowhere>
This commit is contained in:
parent
d5274d9298
commit
f8b09658f4
|
@ -166,7 +166,8 @@ void sub_init_from_sh(struct dec_sub *sub, struct sh_stream *sh)
|
|||
*sd = init_sd;
|
||||
|
||||
if (sub_init_decoder(sub, sd) < 0) {
|
||||
sd->driver->uninit(sd);
|
||||
if (sd->driver && sd->driver->uninit)
|
||||
sd->driver->uninit(sd);
|
||||
talloc_free(sd);
|
||||
MP_ERR(sub, "Could not find subtitle decoder for format '%s'.\n",
|
||||
sh->codec ? sh->codec : "<unknown>");
|
||||
|
|
Loading…
Reference in New Issue