Fix gzip bmp support (test if malloc fails, warning when truncated).
Increase CFG_VIDEO_LOGO_MAX_SIZE on HH405 board. Patch by Stefan Roese, 08 Oct 2005
This commit is contained in:
@@ -779,11 +779,18 @@ int video_display_bitmap (ulong bmp_image, int x, int y)
|
||||
*/
|
||||
len = CFG_VIDEO_LOGO_MAX_SIZE;
|
||||
dst = malloc(CFG_VIDEO_LOGO_MAX_SIZE);
|
||||
if (dst == NULL) {
|
||||
printf("Error: malloc in gunzip failed!\n");
|
||||
return(1);
|
||||
}
|
||||
if (gunzip(dst, CFG_VIDEO_LOGO_MAX_SIZE, (uchar *)bmp_image, &len) != 0) {
|
||||
printf ("Error: no valid bmp or bmp.gz image at %lx\n", bmp_image);
|
||||
free(dst);
|
||||
return 1;
|
||||
}
|
||||
if (len == CFG_VIDEO_LOGO_MAX_SIZE) {
|
||||
printf("Image could be truncated (increase CFG_VIDEO_LOGO_MAX_SIZE)!\n");
|
||||
}
|
||||
|
||||
/*
|
||||
* Set addr to decompressed image
|
||||
|
Reference in New Issue
Block a user