From 60ba05d3d908cca7b40236a5134706522342b881 Mon Sep 17 00:00:00 2001 From: philippe44 Date: Sat, 9 Jul 2022 14:13:04 -0700 Subject: [PATCH] Protect artwork update with mutex - release --- components/squeezelite/displayer.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/squeezelite/displayer.c b/components/squeezelite/displayer.c index 38f8905c..b3354809 100644 --- a/components/squeezelite/displayer.c +++ b/components/squeezelite/displayer.c @@ -875,7 +875,9 @@ static void grfa_handler(u8_t *data, int len) { artwork.size += size; if (artwork.size == length) { GDS_ClearWindow(display, artwork.x, artwork.y, -1, -1, GDS_COLOR_BLACK); + xSemaphoreTake(displayer.mutex, portMAX_DELAY); GDS_DrawJPEG(display, artwork.data, artwork.x, artwork.y, artwork.y < displayer.height ? (GDS_IMAGE_RIGHT | GDS_IMAGE_TOP) : GDS_IMAGE_CENTER); + xSemaphoreGive(displayer.mutex); free(artwork.data); artwork.data = NULL; }