From 03f18260a92bdff82245950e0c2384f4b09f41d6 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Fri, 5 Jul 2019 15:16:02 +0200 Subject: [PATCH] lv_img_decoder_close: fix if closed after error --- src/lv_draw/lv_img_decoder.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lv_draw/lv_img_decoder.c b/src/lv_draw/lv_img_decoder.c index 2fb259db7..5133c2a58 100644 --- a/src/lv_draw/lv_img_decoder.c +++ b/src/lv_draw/lv_img_decoder.c @@ -173,7 +173,9 @@ lv_res_t lv_img_decoder_read_line(lv_img_decoder_dsc_t * dsc, lv_coord_t x, lv_c */ void lv_img_decoder_close(lv_img_decoder_dsc_t * dsc) { - if(dsc->decoder->close_cb) dsc->decoder->close_cb(dsc->decoder, dsc); + if(dsc->decoder) { + if(dsc->decoder->close_cb) dsc->decoder->close_cb(dsc->decoder, dsc); + } } /**