summaryrefslogtreecommitdiffstats
path: root/sub
diff options
context:
space:
mode:
Diffstat (limited to 'sub')
-rw-r--r--sub/dec_sub.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sub/dec_sub.c b/sub/dec_sub.c
index 4746b8f2cc..e29b5bf220 100644
--- a/sub/dec_sub.c
+++ b/sub/dec_sub.c
@@ -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>");