Commit c1a28d0e authored by Henrik Gramner's avatar Henrik Gramner Committed by Henrik Gramner
Browse files

Correctly return an error on malloc failure

dav1d_submit_frame() could erroneously return 0 when tile data memory
allocation failed.

Fixes an assertion failure in dav1d_parse_obus().
parent 0435ec9c
......@@ -3241,7 +3241,10 @@ int dav1d_submit_frame(Dav1dContext *const c) {
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;
if (!f->tile) {
res = DAV1D_ERR(ENOMEM);
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