summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-05-15 13:41:19 +0200
committerDiogo Franco (Kovensky) <diogomfranco@gmail.com>2015-05-19 11:11:24 +0900
commitb4fdb25611d9f3833b705e6fd96fdc11e7c147ed (patch)
tree79361f6c84434d9d338e01b1d337808634c2411b
parenta9cac8ade00298c32e38f44fea2283c8a0c16fa9 (diff)
downloadmpv-b4fdb25611d9f3833b705e6fd96fdc11e7c147ed.tar.bz2
mpv-b4fdb25611d9f3833b705e6fd96fdc11e7c147ed.tar.xz
vf_vapoursynth: reject unaligned video sizes
Leads to some nice memory corruption otherwise. (cherry picked from commit 06bfa9309d848b41ef1394ebc4311a879f8f4093)
-rw-r--r--video/filter/vf_vapoursynth.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/video/filter/vf_vapoursynth.c b/video/filter/vf_vapoursynth.c
index 01cacbf742..ff9421df6f 100644
--- a/video/filter/vf_vapoursynth.c
+++ b/video/filter/vf_vapoursynth.c
@@ -673,6 +673,13 @@ static int config(struct vf_instance *vf, int width, int height,
return 0;
}
+ struct mp_imgfmt_desc desc = mp_imgfmt_get_desc(fmt);
+ if (width % desc.align_x || height % desc.align_y) {
+ MP_FATAL(vf, "VapourSynth does not allow unaligned/cropped video sizes.\n");
+ destroy_vs(vf);
+ return 0;
+ }
+
vf_rescale_dsize(&d_width, &d_height, width, height, vi->width, vi->height);
return vf_next_config(vf, vi->width, vi->height, d_width, d_height, flags, fmt);