decode: don't realloc the tile data buffer when it needs to be enlarged

Its previous contents don't need to be preserved.
parent 3680b11a
......@@ -3195,9 +3195,9 @@ int dav1d_submit_frame(Dav1dContext *const c) {
// FIXME qsort so tiles are in order (for frame threading)
if (f->n_tile_data_alloc < c->n_tile_data) {
struct Dav1dTileGroup *tile = realloc(f->tile, c->n_tile_data * sizeof(*f->tile));
if (!tile) goto error;
f->tile = tile;
freep(&f->tile);
f->tile = malloc(c->n_tile_data * sizeof(*f->tile));
if (!f->tile) goto error;
f->n_tile_data_alloc = c->n_tile_data;
}
memcpy(f->tile, c->tile, c->n_tile_data * sizeof(*f->tile));
......
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