mirror of
https://git.codelinaro.org/clo/qsdk/oss/boot/u-boot-2016.git
synced 2025-12-10 07:44:53 +01:00
common/lcd: add protection from null bmp pointer
If the bmp pointer is null then U-Boot will get stuck when trying to load the image. What's worse, it will get stuck before the U-Boot shell becomes available to the user, thus making it difficult to correct the situation. To protect from the above scenario, check if the pointer is valid. Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
This commit is contained in:
parent
bfdcc65e11
commit
1b09b53e7d
1 changed files with 1 additions and 1 deletions
|
|
@ -674,7 +674,7 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
|
|||
unsigned long pwidth = panel_info.vl_col;
|
||||
unsigned colors, bpix, bmp_bpix;
|
||||
|
||||
if (!((bmp->header.signature[0] == 'B') &&
|
||||
if (!bmp || !((bmp->header.signature[0] == 'B') &&
|
||||
(bmp->header.signature[1] == 'M'))) {
|
||||
printf("Error: no valid bmp image at %lx\n", bmp_image);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue