Commit 613ef787 authored by Janne Grunau's avatar Janne Grunau Committed by Jean-Baptiste Kempf

free tile_thread task_idx_to_sby_and_tile_idx

Fixes emmory leak with asan seen with 'dav1d --tilethreads 2 ...'
parent 3e367ef8
......@@ -2255,6 +2255,7 @@ int dav1d_decode_frame(Dav1dFrameContext *const f) {
if (f->n_tc > 1) {
if (f->frame_hdr.tiling.cols * f->sbh > f->tile_thread.titsati_sz) {
freep(&f->tile_thread.task_idx_to_sby_and_tile_idx);
f->tile_thread.task_idx_to_sby_and_tile_idx =
malloc(sizeof(*f->tile_thread.task_idx_to_sby_and_tile_idx) *
f->frame_hdr.tiling.cols * f->sbh);
......
......@@ -267,6 +267,7 @@ void dav1d_close(Dav1dContext **const c_out) {
pthread_mutex_destroy(&f->tile_thread.lock);
pthread_cond_destroy(&f->tile_thread.cond);
pthread_cond_destroy(&f->tile_thread.icond);
freep(&f->tile_thread.task_idx_to_sby_and_tile_idx);
}
for (int m = 0; m < f->n_tc; m++) {
Dav1dTileContext *const t = &f->tc[m];
......
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