summaryrefslogtreecommitdiffstats
path: root/video/filter/vf.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-06-17 22:44:13 +0200
committerwm4 <wm4@nowhere>2014-06-17 22:44:13 +0200
commitd107cae0e7d625e7bbe0a4e73750f5e3f79ea64e (patch)
tree9e33db39b741cf33ff1781e9021224c5830a2bb7 /video/filter/vf.c
parent72aac9ae8a0053e7c30199044cc2c9493a39b793 (diff)
downloadmpv-d107cae0e7d625e7bbe0a4e73750f5e3f79ea64e.tar.bz2
mpv-d107cae0e7d625e7bbe0a4e73750f5e3f79ea64e.tar.xz
video: check image parameters
Make sure every video filter has valid parameters for input and output. (This also ensures we don't take possibly invalid decoder output, or feed invalid decodr/filter output to VOs.) Also, the updated image size check now (almost) works like the corresponding check in FFmpeg.
Diffstat (limited to 'video/filter/vf.c')
-rw-r--r--video/filter/vf.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/video/filter/vf.c b/video/filter/vf.c
index 045b68f774..0d3f5094e5 100644
--- a/video/filter/vf.c
+++ b/video/filter/vf.c
@@ -568,6 +568,9 @@ static int vf_reconfig_wrapper(struct vf_instance *vf,
vf->fmt_out = vf->fmt_in = *p;
+ if (!mp_image_params_valid(&vf->fmt_in))
+ return -2;
+
int r;
if (vf->reconfig) {
r = vf->reconfig(vf, &vf->fmt_in, &vf->fmt_out);
@@ -580,6 +583,9 @@ static int vf_reconfig_wrapper(struct vf_instance *vf,
if (!mp_image_params_equals(&vf->fmt_in, p))
r = -2;
+ if (!mp_image_params_valid(&vf->fmt_out))
+ r = -2;
+
// Fix csp in case of pixel format change
if (r >= 0)
mp_image_params_guess_csp(&vf->fmt_out);