VirtualBox

Ignore:
Timestamp:
Apr 10, 2019 8:01:12 PM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
129961
Message:

GuestHost/OpenGL,HostServices/SharedOpenGL: Updates bugref:9407

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/presenter/server_presenter.cpp

    r76553 r78105  
    146146static int8_t crFbImgFromDimOffVramBGRA(VBOXCMDVBVAOFFSET offVRAM, uint32_t width, uint32_t height, CR_BLITTER_IMG *pImg)
    147147{
    148     uint32_t cbBuff = width * height * 4;
     148    uint32_t cbBuff;
     149   
     150    if (width == 0 || height == 0)
     151    {
     152        WARN(("invalid param"));
     153        return -1;
     154    }
     155   
     156    cbBuff = width * height * 4;
     157    // Check if overflow happened
     158    if (cbBuff / width != height * 4)
     159    {
     160        WARN(("invalid param"));
     161        return -1;
     162    }
     163   
    149164    if (offVRAM >= g_cbVRam
     165            || UINT32_MAX - cbBuff <= offVRAM
    150166            || offVRAM + cbBuff >= g_cbVRam)
    151167    {
Note: See TracChangeset for help on using the changeset viewer.

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