diff options
author | James Almer <jamrial@gmail.com> | 2019-03-17 02:00:38 +0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2019-03-17 02:17:05 +0300 |
commit | 7350c59e7894cb7e487a0add9942d2b1b39f7161 (patch) | |
tree | 2a89d5ccd9996ba7bc35994ae8fe2a7ff93f708d | |
parent | f821d9ad7b6c13cb52f226df473af4818cb619ed (diff) |
decode: add a frame tile data buffer size check
This check was already done in dav1d_parse_obus(), so it's added as an assert
here for extra precaution.
-rw-r--r-- | src/decode.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/decode.c b/src/decode.c index 63d6f8d..25deffc 100644 --- a/src/decode.c +++ b/src/decode.c @@ -3196,6 +3196,7 @@ 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) { freep(&f->tile); + assert(c->n_tile_data < INT_MAX / (int)sizeof(*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; |