path: root/player/video.c
diff options
authorwm4 <wm4@nowhere>2014-08-11 15:36:47 +0200
committerwm4 <wm4@nowhere>2014-08-11 15:37:13 +0200
commit37357e2265493edf05f81990ad76baf79c982a33 (patch)
treec2e16889582645f3ef071df3f39d320a038c132e /player/video.c
parent33a8e2a9adc45b6a2cb80cf669624154bf0eeb7d (diff)
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.)
Diffstat (limited to 'player/video.c')
1 files changed, 1 insertions, 1 deletions
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;