From ff0680c9b432f087f7fa57cc8f27fdeb4ac578f8 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 27 Jul 2013 21:16:34 +0200 Subject: vf: fix unintended overwriting of image info The symptom was that "-vf scale,format=rgba" broke the vsfilter colorspace hack in sd_ass. vf->reconfig is allowed to overwrite its input parameter for convenience (maybe that was a bad idea). --- video/filter/vf.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'video/filter/vf.c') diff --git a/video/filter/vf.c b/video/filter/vf.c index c6c3766baf..294c306448 100644 --- a/video/filter/vf.c +++ b/video/filter/vf.c @@ -432,7 +432,7 @@ void vf_chain_seek_reset(struct vf_instance *vf) vf_forget_frames(cur); } -int vf_reconfig_wrapper(struct vf_instance *vf, struct mp_image_params *p, +int vf_reconfig_wrapper(struct vf_instance *vf, const struct mp_image_params *p, int flags) { vf_forget_frames(vf); @@ -446,7 +446,8 @@ int vf_reconfig_wrapper(struct vf_instance *vf, struct mp_image_params *p, int r; if (vf->reconfig) { - r = vf->reconfig(vf, p, flags); + struct mp_image_params params = *p; + r = vf->reconfig(vf, ¶ms, flags); } else { r = vf->config(vf, p->w, p->h, p->d_w, p->d_h, flags, p->imgfmt); r = r ? 0 : -1; -- cgit v1.2.3