From bfb695f6270bf1ecc54fc4760673dae3453acb8e Mon Sep 17 00:00:00 2001 From: Ryzee119 Date: Thu, 16 Nov 2023 20:34:36 +1030 Subject: [PATCH] Scroller: Bugs --- src/dash_scroller.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/dash_scroller.c b/src/dash_scroller.c index b61cb82..dda825b 100644 --- a/src/dash_scroller.c +++ b/src/dash_scroller.c @@ -56,14 +56,15 @@ static void jpg_decompression_complete_cb(void *img, void *mem, int w, int h, vo lv_obj_t *image_container = user_data; title_t *t = image_container->user_data; + lvgl_getlock(); + if (img == NULL) { t->jpg_info->decomp_handle = NULL; + lvgl_removelock(); return; } - lvgl_getlock(); - t->jpg_info->mem = mem; t->jpg_info->image = img; t->jpg_info->w = w; @@ -103,8 +104,10 @@ static void update_thumbnail_callback(lv_event_t *event) { t->jpg_info->decomp_handle = jpeg_decoder_queue(t->jpg_info->thumb_path, jpg_decompression_complete_cb, image_container); - jpeg_ll_value_t *n = _lv_ll_ins_tail(&jpeg_decomp_list); - n->image_container = image_container; + if (t->jpg_info->decomp_handle) { + jpeg_ll_value_t *n = _lv_ll_ins_tail(&jpeg_decomp_list); + n->image_container = image_container; + } } // Poke it in cache