Commit 1511ea10 authored by Alex Converse's avatar Alex Converse
Browse files

loop_restoration: Prevent some wild memory access

On recode frames the encoder will attempt to serialize the bitstream
before choosing loop filter parameters to get a rough size estimate.
This can result in wild reads in encode restoration if leftover values
from the previous frame aren't available.

Even with a realloc instead of free-ing and reallocing all the data,
wild reads are possible on frame size changes.

Change-Id: I9956d9e11c6ed61999563436051c2fe469718538
parent 0b96b479
......@@ -59,6 +59,7 @@ typedef void (*restore_func_highbd_type)(uint8_t *data8, int width, int height,
int av1_alloc_restoration_struct(AV1_COMMON *cm, RestorationInfo *rst_info,
int width, int height) {
const int ntiles = av1_get_rest_ntiles(width, height, NULL, NULL, NULL, NULL);
rst_info->frame_restoration_type = RESTORE_NONE;
CHECK_MEM_ERROR(cm, rst_info->restoration_type,
(RestorationType *)aom_malloc(
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