summaryrefslogtreecommitdiffstats
path: root/video/filter/vf_phase.c
diff options
context:
space:
mode:
authorMartin Herkt <lachs0r@srsfckn.biz>2013-04-10 00:10:59 +0200
committerMartin Herkt <lachs0r@srsfckn.biz>2013-04-10 00:22:00 +0200
commitf8d32b03bfa8ad733da7ae824a580b3474c1be58 (patch)
tree1cf5e1172bbf1cd6308338dfb4d51e036d37d7b1 /video/filter/vf_phase.c
parent23bbbed06d9681728daa8f64190688c92562326a (diff)
downloadmpv-f8d32b03bfa8ad733da7ae824a580b3474c1be58.tar.bz2
mpv-f8d32b03bfa8ad733da7ae824a580b3474c1be58.tar.xz
vf_divtc, vf_phase: Fix handling of subsampled formats
These filters incorrectly calculated the amount of bytes per line in each plane for chroma subsampled formats, causing undefined behavior.
Diffstat (limited to 'video/filter/vf_phase.c')
-rw-r--r--video/filter/vf_phase.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/video/filter/vf_phase.c b/video/filter/vf_phase.c
index 45d5e4ae44..0b31ede5e5 100644
--- a/video/filter/vf_phase.c
+++ b/video/filter/vf_phase.c
@@ -205,7 +205,7 @@ static struct mp_image *filter(struct vf_instance *vf, struct mp_image *mpi)
int pw[MP_MAX_PLANES] = {0};
for (int p = 0; p < mpi->num_planes; p++)
- pw[p] = (mpi->w * mpi->fmt.bpp[p] + 7) / 8;
+ pw[p] = ((mpi->w * mpi->fmt.bpp[p] + 7) / 8) >> mpi->fmt.xs[p];
mode=vf->priv->mode;