From 5146c3043fa559eab454a7c71f7045e2e016f2e7 Mon Sep 17 00:00:00 2001 From: Christian Soffke Date: Mon, 13 Dec 2021 00:07:39 +0100 Subject: [PATCH] pictureflow: Fix concurrency issues building art cache Guards against possible image corruption Change-Id: Id7e1e3a09cb13c255eea0ffdd2e4c4d558086997 --- apps/plugins/pictureflow/pictureflow.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/plugins/pictureflow/pictureflow.c b/apps/plugins/pictureflow/pictureflow.c index a2782b6a2b..65efed72c7 100644 --- a/apps/plugins/pictureflow/pictureflow.c +++ b/apps/plugins/pictureflow/pictureflow.c @@ -4416,7 +4416,12 @@ static int pictureflow_main(const char* selected_file) break; case pf_idle: render_all_slides(); - incremental_albumart_cache(false); + if (aa_cache.inspected < pf_idx.album_ct) + { + buf_ctx_lock(); + incremental_albumart_cache(false); + buf_ctx_unlock(); + } break; }