From ecf72597ef8d5fdae4a069f18704e6d079b792a2 Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Sun, 18 Nov 2018 16:58:52 -0500 Subject: Clip resize height to image size Fixes #183. --- src/recon_tmpl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/recon_tmpl.c b/src/recon_tmpl.c index 72927b9..2a2d080 100644 --- a/src/recon_tmpl.c +++ b/src/recon_tmpl.c @@ -1616,9 +1616,10 @@ void bytefn(dav1d_filter_sbrow)(Dav1dFrameContext *const f, const int sby) { const int ss_hor = pl && f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I444; const int dst_w = (f->sr_cur.p.p.w + ss_hor) >> ss_hor; const int src_w = (4 * f->bw + ss_hor) >> ss_hor; + const int img_h = (f->cur.p.h - sbsz * 4 * sby + ss_ver) >> ss_ver; f->dsp->mc.resize(dst, dst_stride, src, src_stride, dst_w, src_w, - h_end + h_start, f->resize_step[!!pl], + imin(img_h, h_end) + h_start, f->resize_step[!!pl], f->resize_start[!!pl]); } } -- cgit v1.2.3