Revert "Conditionally allocate frame mv buffer" This reverts commit 12a16c2980184c16684a7d222e0bbac1b8bfd5a2. Reason for revert: This causes ASan errors with fuzzed input Bug: oss-fuzz:49652 Change-Id: I7ea1bf91e609ba0a96e394f6a343f3bde1b4831d
diff --git a/av1/common/av1_common_int.h b/av1/common/av1_common_int.h index a7c20f5..fd2ec06 100644 --- a/av1/common/av1_common_int.h +++ b/av1/common/av1_common_int.h
@@ -1219,26 +1219,21 @@ const int buf_cols = buf->mi_cols; const CommonModeInfoParams *const mi_params = &cm->mi_params; - if (buf->seg_map == NULL || buf_rows != mi_params->mi_rows || + if (buf->mvs == NULL || buf_rows != mi_params->mi_rows || buf_cols != mi_params->mi_cols) { + aom_free(buf->mvs); buf->mi_rows = mi_params->mi_rows; buf->mi_cols = mi_params->mi_cols; + CHECK_MEM_ERROR(cm, buf->mvs, + (MV_REF *)aom_calloc(((mi_params->mi_rows + 1) >> 1) * + ((mi_params->mi_cols + 1) >> 1), + sizeof(*buf->mvs))); aom_free(buf->seg_map); CHECK_MEM_ERROR( cm, buf->seg_map, (uint8_t *)aom_calloc(mi_params->mi_rows * mi_params->mi_cols, sizeof(*buf->seg_map))); } - if (buf->mvs == NULL || buf_rows != mi_params->mi_rows || - buf_cols != mi_params->mi_cols) { - if (cm->seq_params->order_hint_info.enable_ref_frame_mvs) { - aom_free(buf->mvs); - CHECK_MEM_ERROR(cm, buf->mvs, - (MV_REF *)aom_calloc(((mi_params->mi_rows + 1) >> 1) * - ((mi_params->mi_cols + 1) >> 1), - sizeof(*buf->mvs))); - } - } const int mem_size = ((mi_params->mi_rows + MAX_MIB_SIZE) >> 1) * (mi_params->mi_stride >> 1);