mirror of https://github.com/mpv-player/mpv
vf_vapoursynth: reject unaligned video sizes
Leads to some nice memory corruption otherwise.
This commit is contained in:
parent
372b85b9d2
commit
06bfa9309d
|
@ -673,6 +673,13 @@ static int config(struct vf_instance *vf, int width, int height,
|
||||||
return 0;
|
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);
|
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);
|
return vf_next_config(vf, vi->width, vi->height, d_width, d_height, flags, fmt);
|
||||||
|
|
Loading…
Reference in New Issue