shithub: dav1d

Download patch

ref: 613ef787956f5c8c1cb018f120b78c95c32cb2b9
parent: 3e367ef80a356c86c39cbd67285d4ac42fd0a9bb
author: Janne Grunau <[email protected]>
date: Sat Oct 13 08:21:32 EDT 2018

free tile_thread task_idx_to_sby_and_tile_idx

Fixes emmory leak with asan seen with 'dav1d --tilethreads 2 ...'

--- a/src/decode.c
+++ b/src/decode.c
@@ -2255,6 +2255,7 @@
 
     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);
--- a/src/lib.c
+++ b/src/lib.c
@@ -267,6 +267,7 @@
             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];