summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-11-11 18:47:21 +0100
committerwm4 <wm4@nowhere>2014-11-11 18:47:21 +0100
commit599a4a8769d0c76c596f207f9d920ae2722cd2a3 (patch)
tree409882f74379ff86a9706bf5d80ab74dab5b378a /video
parent67e0230905ff6f725806d2aa907dad8f7e1f4c7a (diff)
downloadmpv-599a4a8769d0c76c596f207f9d920ae2722cd2a3.tar.bz2
mpv-599a4a8769d0c76c596f207f9d920ae2722cd2a3.tar.xz
vf_sub: don't crash if no subtitle context is available
Happens with --vf=sub,sub (only the first one gets the context).
Diffstat (limited to 'video')
-rw-r--r--video/filter/vf_sub.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/video/filter/vf_sub.c b/video/filter/vf_sub.c
index e2d633dce7..b9551d59da 100644
--- a/video/filter/vf_sub.c
+++ b/video/filter/vf_sub.c
@@ -94,6 +94,9 @@ static struct mp_image *filter(struct vf_instance *vf, struct mp_image *mpi)
struct vf_priv_s *priv = vf->priv;
struct osd_state *osd = priv->osd;
+ if (!osd)
+ return mpi;
+
if (vf->priv->opt_top_margin || vf->priv->opt_bottom_margin) {
struct mp_image *dmpi = vf_alloc_out_image(vf);
if (!dmpi)