From d2a10fb02e92234138332b930ccc870f447c1655 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 3 Oct 2019 00:31:20 +0200 Subject: vf_vapoursynth: do not call vsscript_finalize() if init failed If vsscript_finalize() is not matched by a successful vsscript_init(), an assert in the vsscript library triggers. Makes sense, I guess. --- video/filter/vf_vapoursynth.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'video') diff --git a/video/filter/vf_vapoursynth.c b/video/filter/vf_vapoursynth.c index b5be48ce1f..9edcf36792 100644 --- a/video/filter/vf_vapoursynth.c +++ b/video/filter/vf_vapoursynth.c @@ -62,6 +62,7 @@ struct priv { const struct script_driver *drv; // drv_vss + bool vs_initialized; struct VSScript *se; struct mp_filter *f; @@ -814,12 +815,15 @@ static int drv_vss_init(struct priv *p) MP_FATAL(p, "Could not initialize VapourSynth scripting.\n"); return -1; } + p->vs_initialized = true; return 0; } static void drv_vss_uninit(struct priv *p) { - vsscript_finalize(); + if (p->vs_initialized) + vsscript_finalize(); + p->vs_initialized = false; } static int drv_vss_load_core(struct priv *p) -- cgit v1.2.3