Commit 9868c747 authored by Debargha Mukherjee's avatar Debargha Mukherjee

Fix crash with cb4x4 and warped-motion

BUG=aomedia:314

Change-Id: I66af7f69ca0b97b9d840918a6b9ec34708a7f4e5
parent 83c26636
......@@ -1087,6 +1087,7 @@ int findSamples(const AV1_COMMON *cm, MACROBLOCKD *xd, int mi_row, int mi_col,
}
}
}
assert(2 * np <= SAMPLES_ARRAY_SIZE);
// scan the left column
if (left_available) {
......@@ -1129,6 +1130,7 @@ int findSamples(const AV1_COMMON *cm, MACROBLOCKD *xd, int mi_row, int mi_col,
}
}
}
assert(2 * np <= SAMPLES_ARRAY_SIZE);
if (left_available && up_available) {
int mi_row_offset = -1;
......@@ -1166,6 +1168,7 @@ int findSamples(const AV1_COMMON *cm, MACROBLOCKD *xd, int mi_row, int mi_col,
np += pixelperblock;
}
}
assert(2 * np <= SAMPLES_ARRAY_SIZE);
for (i = 0; i < (mvnumber - 1); ++i) {
if (mvasint[i] != mvasint[i + 1]) break;
......@@ -1200,6 +1203,7 @@ int findSamples(const AV1_COMMON *cm, MACROBLOCKD *xd, int mi_row, int mi_col,
}
np += pixelperblock;
}
assert(2 * np <= SAMPLES_ARRAY_SIZE);
return np;
}
......
......@@ -413,7 +413,7 @@ static uint8_t warp_interpolate(uint8_t *ref, int x, int y, int width,
// [-1, 2) * WARPEDPIXEL_PREC_SHIFTS.
// We need an extra 2 taps to fit this in, for a total of 8 taps.
/* clang-format off */
const int16_t warped_filter[WARPEDPIXEL_PREC_SHIFTS*3][8] = {
const int16_t warped_filter[WARPEDPIXEL_PREC_SHIFTS * 3][8] = {
// [-1, 0)
{ 0, 0, 128, 0, 0, 0, 0, 0 }, { 0, - 1, 128, 2, - 1, 0, 0, 0 },
{ 1, - 3, 127, 4, - 1, 0, 0, 0 }, { 1, - 4, 126, 6, - 2, 1, 0, 0 },
......
......@@ -25,6 +25,8 @@
#define MAX_PARAMDIM 9
#if CONFIG_WARPED_MOTION
#define SAMPLES_PER_NEIGHBOR 4
#define SAMPLES_ARRAY_SIZE ((2 * MAX_MIB_SIZE + 2) * SAMPLES_PER_NEIGHBOR * 2)
#define DEFAULT_WMTYPE ROTZOOM
#endif // CONFIG_WARPED_MOTION
......
......@@ -1510,7 +1510,7 @@ static void read_inter_block_mode_info(AV1Decoder *const pbi,
#endif // CONFIG_REF_MV && CONFIG_EXT_INTER
int16_t mode_ctx = 0;
#if CONFIG_WARPED_MOTION
double pts[144], pts_inref[144];
double pts[SAMPLES_ARRAY_SIZE], pts_inref[SAMPLES_ARRAY_SIZE];
#endif // CONFIG_WARPED_MOTION
#if CONFIG_EC_ADAPT
FRAME_CONTEXT *ec_ctx = xd->tile_ctx;
......
......@@ -7818,7 +7818,7 @@ static int64_t handle_inter_mode(
#endif // CONFIG_EXT_INTER
#endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
#if CONFIG_WARPED_MOTION
double pts[144], pts_inref[144];
double pts[SAMPLES_ARRAY_SIZE], pts_inref[SAMPLES_ARRAY_SIZE];
#endif // CONFIG_WARPED_MOTION
int64_t rd = INT64_MAX;
BUFFER_SET orig_dst, tmp_dst;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment