ref: faa090082febba0719d650238ce0cc51565551ed
parent: 3fdb6cc9bdec93f2cb39afdf8ccceffe248340e6
author: Janne Grunau <janne-vlc@jannau.net>
date: Wed Nov 14 07:21:21 EST 2018
mc: ensure order of evaluation of macro arguments in FILTER_BILIN Fixes undefined shifts in put_bilin_scaled_c with clusterfuzz-testcase-minimized-dav1d_fuzzer_mt-5732654503165952. Credits to oss-fuzz.
--- a/src/mc_tmpl.c
+++ b/src/mc_tmpl.c
@@ -335,7 +335,7 @@
filter_fns(sharp_smooth, FILTER_8TAP_SHARP, FILTER_8TAP_SMOOTH)
#define FILTER_BILIN(src, x, mxy, stride) \
- (16 * src[x] + (mxy * (src[x + stride] - src[x])))
+ (16 * src[x] + ((mxy) * (src[x + stride] - src[x])))
#define FILTER_BILIN_RND(src, x, mxy, stride, sh) \
((FILTER_BILIN(src, x, mxy, stride) + ((1 << sh) >> 1)) >> sh)