Skip to content

Commit 60ba05d

Browse files
committed
Protect artwork update with mutex - release
1 parent 099d9ff commit 60ba05d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

components/squeezelite/displayer.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -875,7 +875,9 @@ static void grfa_handler(u8_t *data, int len) {
875875
artwork.size += size;
876876
if (artwork.size == length) {
877877
GDS_ClearWindow(display, artwork.x, artwork.y, -1, -1, GDS_COLOR_BLACK);
878+
xSemaphoreTake(displayer.mutex, portMAX_DELAY);
878879
GDS_DrawJPEG(display, artwork.data, artwork.x, artwork.y, artwork.y < displayer.height ? (GDS_IMAGE_RIGHT | GDS_IMAGE_TOP) : GDS_IMAGE_CENTER);
880+
xSemaphoreGive(displayer.mutex);
879881
free(artwork.data);
880882
artwork.data = NULL;
881883
}

0 commit comments

Comments
 (0)