- len = CFG_VIDEO_LOGO_MAX_SIZE;
- dst = malloc(CFG_LCD_LOGO_MAX_SIZE);
- do_free = 1;
- if (gunzip(dst, CFG_LCD_LOGO_MAX_SIZE, (uchar *)logo_bmp, &len) != 0) {
- return;
+ len = CONFIG_SYS_VIDEO_LOGO_MAX_SIZE;
+ dst = malloc(CONFIG_SYS_VIDEO_LOGO_MAX_SIZE);
+ if (dst == NULL) {
+ printf("Error: malloc for gunzip failed!\n");
+ return 1;
+ }
+ if (gunzip(dst, CONFIG_SYS_VIDEO_LOGO_MAX_SIZE,
+ (uchar *)logo_bmp, &len) != 0) {
+ free(dst);
+ return 1;
+ }
+ if (len == CONFIG_SYS_VIDEO_LOGO_MAX_SIZE) {
+ printf("Image could be truncated"
+ " (increase CONFIG_SYS_VIDEO_LOGO_MAX_SIZE)!\n");