Commit e166e25f authored by Debargha Mukherjee's avatar Debargha Mukherjee

Fix a crash due to a large stack allocation

Change-Id: Icba19c399531a6e50ab466b606b8921f9b57eae9
parent aa229d6d
......@@ -640,7 +640,8 @@ static void loop_sgrproj_filter_tile(uint8_t *data, int tile_idx, int width,
int i, j;
int h_start, h_end, v_start, v_end;
uint8_t *data_p;
int64_t dat[RESTORATION_TILEPELS_MAX];
int64_t *dat = (int64_t *)tmpbuf;
tmpbuf = (uint8_t *)tmpbuf + RESTORATION_TILEPELS_MAX * sizeof(*dat);
if (rst->rsi->sgrproj_info[tile_idx].level == 0) return;
av1_get_rest_tile_limits(tile_idx, 0, 0, rst->nhtiles, rst->nvtiles,
......@@ -876,7 +877,8 @@ static void loop_sgrproj_filter_tile_highbd(uint16_t *data, int tile_idx,
int i, j;
int h_start, h_end, v_start, v_end;
uint16_t *data_p;
int64_t dat[RESTORATION_TILEPELS_MAX];
int64_t *dat = (int64_t *)tmpbuf;
tmpbuf = (uint8_t *)tmpbuf + RESTORATION_TILEPELS_MAX * sizeof(*dat);
if (rst->rsi->sgrproj_info[tile_idx].level == 0) return;
av1_get_rest_tile_limits(tile_idx, 0, 0, rst->nhtiles, rst->nvtiles,
......
......@@ -25,7 +25,7 @@ extern "C" {
#define RESTORATION_TILESIZE_BIG 256
#define RESTORATION_TILEPELS_MAX \
(RESTORATION_TILESIZE_BIG * RESTORATION_TILESIZE_BIG * 9 / 4)
#define SGRPROJ_TMPBUF_SIZE (RESTORATION_TILEPELS_MAX * 5 * 8)
#define SGRPROJ_TMPBUF_SIZE (RESTORATION_TILEPELS_MAX * 6 * 8)
#define SGRPROJ_PARAMS_BITS 3
#define SGRPROJ_PARAMS (1 << SGRPROJ_PARAMS_BITS)
......
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