diff --git a/demos/stress/lv_demo_stress.c b/demos/stress/lv_demo_stress.c index 4fa5af3e8..e7505bf53 100644 --- a/demos/stress/lv_demo_stress.c +++ b/demos/stress/lv_demo_stress.c @@ -242,10 +242,11 @@ static void obj_test_task_cb(lv_timer_t * tmr) case 14: obj = lv_msgbox_create(NULL, "Title", "Some text on the message box with average length", mbox_buttons, true); - - lv_timer_t * msgbox_tmr = lv_timer_create(msgbox_delete, LV_DEMO_STRESS_TIME_STEP * 5 + 30, obj); - lv_timer_set_repeat_count(msgbox_tmr, 1); - lv_obj_align(obj, LV_ALIGN_RIGHT_MID, -10, 0); + { + lv_timer_t * msgbox_tmr = lv_timer_create(msgbox_delete, LV_DEMO_STRESS_TIME_STEP * 5 + 30, obj); + lv_timer_set_repeat_count(msgbox_tmr, 1); + lv_obj_align(obj, LV_ALIGN_RIGHT_MID, -10, 0); + } break; case 15: diff --git a/src/widgets/image/lv_image.c b/src/widgets/image/lv_image.c index 93281293d..8880f4024 100644 --- a/src/widgets/image/lv_image.c +++ b/src/widgets/image/lv_image.c @@ -151,7 +151,13 @@ void lv_image_set_src(lv_obj_t * obj, const void * src) } lv_image_header_t header; - lv_image_decoder_get_info(src, &header); + lv_result_t res = lv_image_decoder_get_info(src, &header); + if(res != LV_RESULT_OK) { + char buf[24]; + LV_LOG_WARN("failed to get image info: %s", + src_type == LV_IMAGE_SRC_FILE ? (const char *)src : (lv_snprintf(buf, sizeof(buf), "%p", src), buf)); + return; + } /*Save the source*/ if(src_type == LV_IMAGE_SRC_VARIABLE) {