From a46ca6ec00aa0a8bdb0e0fff4ddd2db4257b3cbf Mon Sep 17 00:00:00 2001 From: James Zern Date: Sat, 30 Aug 2014 20:33:52 -0700 Subject: [PATCH] vp9_loop_filter_frame_mt: defer allocations the code currently checks whether the allocation has been done instead of allocating on the first frame. since: 4f27202 vp9: fix crash in mt loopfilter w/corrupt file this change defers the allocation until the loop filter is used. Change-Id: I660c1b7f34e713a8dd9884483f01d23b9847366e --- vp9/decoder/vp9_dthread.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/vp9/decoder/vp9_dthread.c b/vp9/decoder/vp9_dthread.c index e6ce14d09..1572aa4ab 100644 --- a/vp9/decoder/vp9_dthread.c +++ b/vp9/decoder/vp9_dthread.c @@ -145,15 +145,13 @@ void vp9_loop_filter_frame_mt(YV12_BUFFER_CONFIG *frame, const int num_workers = MIN(pbi->max_threads & ~1, tile_cols); int i; - // Allocate memory used in thread synchronization. - // This always needs to be done even if frame_filter_level is 0. + if (!frame_filter_level) return; + if (!lf_sync->sync_range || cm->last_height != cm->height) { vp9_loop_filter_dealloc(lf_sync); vp9_loop_filter_alloc(lf_sync, cm, sb_rows, cm->width); } - if (!frame_filter_level) return; - vp9_loop_filter_frame_init(cm, frame_filter_level); // Initialize cur_sb_col to -1 for all SB rows. -- 2.40.0