From f4eaceee0fe24a59828ce37f61173b1dd2afd8d4 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 1 May 2014 23:06:23 +0200 Subject: vf: sanitize filter input, instead of overriding it vf_fix_img_params() takes care of overwriting image parameters that are normally not set correctly by filters. But this makes no sense for input images. So instead, check that the input is correct. It still has to be done for the first input image, because that's used to handle some overrides (see video_reconfig_filters()). --- video/filter/vf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/video/filter/vf.c b/video/filter/vf.c index 0939631ca4..08391290a3 100644 --- a/video/filter/vf.c +++ b/video/filter/vf.c @@ -378,7 +378,7 @@ static int vf_do_filter(struct vf_instance *vf, struct mp_image *img) { assert(vf->fmt_in.imgfmt); if (img) - vf_fix_img_params(img, &vf->fmt_in); + assert(mp_image_params_equals(&img->params, &vf->fmt_in)); if (vf->filter_ext) { int r = vf->filter_ext(vf, img); @@ -404,6 +404,7 @@ int vf_filter_frame(struct vf_chain *c, struct mp_image *img) talloc_free(img); return -1; } + vf_fix_img_params(img, &c->input_params); return vf_do_filter(c->first, img); } -- cgit v1.2.3