Fix out-of-bound buffer access when explict_order_hint is on
This commit increases the division multiplier buffer size used
by mfmv projection to 128. It solves the out-of-bound buffer access
when CONFIG_EXPLICIT_ORDER_HINT is turned on.
BUG=aomedia:1593
Change-Id: I3297f2bf40d195c473263d24359c3451352bde6a
diff --git a/av1/common/mvref_common.c b/av1/common/mvref_common.c
index a720212..02834e0 100644
--- a/av1/common/mvref_common.c
+++ b/av1/common/mvref_common.c
@@ -18,6 +18,20 @@
// Although we assign 32 bit integers, all the values are strictly under 14
// bits.
+#if CONFIG_EXPLICIT_ORDER_HINT
+static int div_mult[MAX_FRAME_DISTANCE + 1] = {
+ 0, 16384, 8192, 5461, 4096, 3276, 2730, 2340, 2048, 1820, 1638, 1489, 1365,
+ 1260, 1170, 1092, 1024, 963, 910, 862, 819, 780, 744, 712, 682, 655,
+ 630, 606, 585, 564, 546, 528, 512, 496, 481, 468, 455, 442, 431,
+ 420, 409, 399, 390, 381, 372, 364, 356, 348, 341, 334, 327, 321,
+ 315, 309, 303, 297, 292, 287, 282, 277, 273, 268, 264, 260, 256,
+ 252, 248, 244, 240, 237, 234, 230, 227, 224, 221, 218, 215, 212,
+ 210, 207, 204, 202, 199, 197, 195, 192, 190, 188, 186, 184, 182,
+ 180, 178, 176, 174, 172, 170, 168, 167, 165, 163, 162, 160, 159,
+ 157, 156, 154, 153, 151, 150, 148, 147, 146, 144, 143, 142, 141,
+ 140, 138, 137, 136, 135, 134, 133, 132, 131, 130, 129,
+};
+#else
static int div_mult[64] = {
0, 16384, 8192, 5461, 4096, 3276, 2730, 2340, 2048, 1820, 1638, 1489, 1365,
1260, 1170, 1092, 1024, 963, 910, 862, 819, 780, 744, 712, 682, 655,
@@ -25,6 +39,7 @@
420, 409, 399, 390, 381, 372, 364, 356, 348, 341, 334, 327, 321,
315, 309, 303, 297, 292, 287, 282, 277, 273, 268, 264, 260,
};
+#endif
// TODO(jingning): Consider the use of lookup table for (num / den)
// altogether.