From 37357e2265493edf05f81990ad76baf79c982a33 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 11 Aug 2014 15:36:47 +0200 Subject: video: fix dangling pointer issue The function video_decode_and_filter(), called between initializing the local vf variable and using it, can actually destroy and recreate the filter. Thus, the vf variable turns into a dangling pointer if that happens. Could be observed with: --hwdec=vda --deinterlace=yes --vf=yadif (Also happens with vdpau/vaapi.) --- player/video.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'player/video.c') diff --git a/player/video.c b/player/video.c index 538008302c..73e8ef9d49 100644 --- a/player/video.c +++ b/player/video.c @@ -486,7 +486,6 @@ static void init_vo(struct MPContext *mpctx) static int video_output_image(struct MPContext *mpctx, double endpts, bool reconfig_ok) { - struct vf_chain *vf = mpctx->d_video->vfilter; struct vo *vo = mpctx->video_out; // Already enough video buffered in VO? @@ -499,6 +498,7 @@ static int video_output_image(struct MPContext *mpctx, double endpts, if (r < 0) return r; // error + struct vf_chain *vf = mpctx->d_video->vfilter; vf_output_frame(vf, false); if (vf->output) { double pts = vf->output->pts; -- cgit v1.2.3