diff options
author | Janne Grunau <janne-vlc@jannau.net> | 2018-11-13 02:33:14 +0300 |
---|---|---|
committer | Janne Grunau <janne-vlc@jannau.net> | 2018-11-13 02:53:37 +0300 |
commit | 4a646a0ca25a22a809bfcb743332f6b6646d86a3 (patch) | |
tree | 4421d84c305f61ff39f997799dc2426cc0d7ec54 | |
parent | 8948e5af3dcbf9e830fed38347ac600de7fcf3e4 (diff) |
intra_pred: fix ubsan issues with max_width/height in 2f251bd11528
Seen with clusterfuzz-testcase-minimized-dav1d_fuzzer-5712042518904832.
-rw-r--r-- | src/ipred_tmpl.c | 2 | ||||
-rw-r--r-- | src/recon_tmpl.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/ipred_tmpl.c b/src/ipred_tmpl.c index 8a7adb1..e928bfb 100644 --- a/src/ipred_tmpl.c +++ b/src/ipred_tmpl.c @@ -349,7 +349,7 @@ static void filter_edge(pixel *const out, const int sz, assert(strength > 0); int i = 0; - for (; i < lim_from; i++) + for (; i < imin(sz, lim_from); i++) out[i] = in[iclip(i, from, to - 1)]; for (; i < imin(lim_to, sz); i++) { int s = 0; diff --git a/src/recon_tmpl.c b/src/recon_tmpl.c index f26564f..ad4235f 100644 --- a/src/recon_tmpl.c +++ b/src/recon_tmpl.c @@ -986,7 +986,7 @@ void bytefn(dav1d_recon_b_intra)(Dav1dTileContext *const t, const enum BlockSize angle | sm_uv_fl, (f->cur.p.p.w + ss_hor - 4 * (t->bx & ~ss_hor)) >> ss_hor, - (f->cur.p.p.w + ss_ver - + (f->cur.p.p.h + ss_ver - 4 * (t->by & ~ss_ver)) >> ss_ver); if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS) { hex_dump(edge - uv_t_dim->h * 4, uv_t_dim->h * 4, |