Merge pull request #948 from enkiller/gui_img_hdc_c

[gui]解决不使用fastlz包时,GUI解码fastlz压缩的hdc格式图片,系统会宕机问题
This commit is contained in:
Bernard Xiong 2017-11-04 14:08:54 +08:00 committed by GitHub
commit 633507228a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -128,7 +128,8 @@ static rt_bool_t rtgui_image_hdc_load(struct rtgui_image *image, struct rtgui_fi
{ {
if (header[3] == 2) 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; int data_length, dec_length;
rt_uint8_t *data; 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; hdc->pixel_offset = 0;
rtgui_free(data); rtgui_free(data);
#else
hdc->pixels = RT_NULL;
return RT_FALSE;
#endif #endif
} }
else else