summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorBernard Xiong <[email protected]>2017-11-04 14:08:54 +0800
committerGitHub <[email protected]>2017-11-04 14:08:54 +0800
commit633507228a0562d4896d17fd3a3c08b8d60cf7a7 (patch)
treeb306f30409c42f0b0660194f2daea4dacd6bd7e8 /components
parentb866753adaa557723d9b1cb2edcd682194ead855 (diff)
parent9a47193bcdf64a9d8879d2dcfc25c12db2e5493b (diff)
Merge pull request #948 from enkiller/gui_img_hdc_c
[gui]解决不使用fastlz包时,GUI解码fastlz压缩的hdc格式图片,系统会宕机问题
Diffstat (limited to 'components')
-rw-r--r--components/gui/src/image_hdc.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/components/gui/src/image_hdc.c b/components/gui/src/image_hdc.c
index b82a10625b..b8563c5887 100644
--- a/components/gui/src/image_hdc.c
+++ b/components/gui/src/image_hdc.c
@@ -128,7 +128,8 @@ static rt_bool_t rtgui_image_hdc_load(struct rtgui_image *image, struct rtgui_fi
{
if (header[3] == 2)
{
-#if 0 /* TODO: add HDC with fastlz compressed */
+#ifdef PKG_USING_FASTLZ
+ /* TODO: add HDC with fastlz compressed */
int data_length, dec_length;
rt_uint8_t *data;
@@ -173,6 +174,9 @@ static rt_bool_t rtgui_image_hdc_load(struct rtgui_image *image, struct rtgui_fi
}
hdc->pixel_offset = 0;
rtgui_free(data);
+#else
+ hdc->pixels = RT_NULL;
+ return RT_FALSE;
#endif
}
else