Commit 94e3856e authored by Frederic Barbier's avatar Frederic Barbier Committed by Frédéric BARBIER

Fix memory corruption

Fix a memory corruption introduced by commit
f190a165

On some cases, when empty tiles are present,
av1_set_across_tile_boundary_info() writes beyond mode info array.

Sanity check added.

BUG=aomedia:690

Change-Id: I8d87a2e183c69d0ed039c8b2f77b30434f837974
parent 5a978838
......@@ -113,6 +113,7 @@ void av1_setup_across_tile_boundary_info(const AV1_COMMON *const cm,
const int mi_row = tile_info->mi_row_start;
const int mi_col = tile_info->mi_col_start;
MODE_INFO *const mi_start = cm->mi + mi_row * cm->mi_stride + mi_col;
assert(mi_start < cm->mip + cm->mi_alloc_size);
MODE_INFO *mi = 0;
const int row_diff = tile_info->mi_row_end - tile_info->mi_row_start;
const int col_diff = tile_info->mi_col_end - tile_info->mi_col_start;
......
......@@ -3703,6 +3703,10 @@ static void daala_dec_init(AV1_COMMON *const cm, daala_dec_ctx *daala_dec,
static void dec_setup_across_tile_boundary_info(
const AV1_COMMON *const cm, const TileInfo *const tile_info) {
if (tile_info->mi_row_start >= tile_info->mi_row_end ||
tile_info->mi_col_start >= tile_info->mi_col_end)
return;
if (cm->width != cm->last_width || cm->height != cm->last_height ||
cm->tile_cols != cm->last_tile_cols ||
cm->tile_rows != cm->last_tile_rows) {
......
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