diff options
author | James Almer <jamrial@gmail.com> | 2019-03-17 01:46:18 +0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2019-03-17 01:47:10 +0300 |
commit | f821d9ad7b6c13cb52f226df473af4818cb619ed (patch) | |
tree | 62378b952deeeb58b8d505d694bcf411085004e9 | |
parent | 3680b11a60ed63893705d877c75e78a1a4860f3c (diff) |
decode: don't realloc the tile data buffer when it needs to be enlarged
Its previous contents don't need to be preserved.
-rw-r--r-- | src/decode.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/decode.c b/src/decode.c index a199849..63d6f8d 100644 --- a/src/decode.c +++ b/src/decode.c @@ -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)); |