VirtualBox

Changeset 88545 in vbox for trunk/src/VBox/Devices/Graphics


Ignore:
Timestamp:
Apr 15, 2021 1:59:03 PM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
143825
Message:

Retrieve BMP file header info, bugref:9904

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Graphics/DevVGA.cpp

    r87904 r88545  
    39223922                               ("Unsupported %u compression.\n", pThisCC->LogoCompression),
    39233923                               VERR_INVALID_PARAMETER);
     3924
     3925        AssertLogRelMsgReturn(pFileHdr->cbFileSize > pFileHdr->offBits,
     3926                               ("Wrong bitmap data offset %u.\n", pFileHdr->offBits),
     3927                               VERR_INVALID_PARAMETER);
     3928
     3929        uint32_t cbFileData = pFileHdr->cbFileSize - pFileHdr->offBits;
     3930        uint32_t cbImageData = pThisCC->cxLogo * pThisCC->cyLogo * pThisCC->cLogoPlanes;
     3931
     3932        /* TBD: Take 32bit rows padding into account */
     3933        if (pThisCC->cLogoBits == 4)
     3934        {
     3935            cbImageData /= 2;
     3936        } else if (pThisCC->cLogoBits == 24)
     3937        {
     3938            cbImageData *= 3;
     3939        }
     3940
     3941        AssertLogRelMsgReturn(cbImageData <= cbFileData,
     3942            ("Wrong BMP header data %d\n", cbImageData),
     3943            VERR_INVALID_PARAMETER);
    39243944
    39253945        /*
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette