diff options
author | wm4 <wm4@nowhere> | 2019-10-03 00:31:20 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2019-10-03 00:48:12 +0200 |
commit | d2a10fb02e92234138332b930ccc870f447c1655 (patch) | |
tree | e166d81495651855edf3b1e1c20064a4767dff00 | |
parent | f36ae05aca3a31dbb192b734fdb4d7ca409db1ac (diff) | |
download | mpv-d2a10fb02e92234138332b930ccc870f447c1655.tar.bz2 mpv-d2a10fb02e92234138332b930ccc870f447c1655.tar.xz |
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.
-rw-r--r-- | video/filter/vf_vapoursynth.c | 6 |
1 files changed, 5 insertions, 1 deletions
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) |