VirtualBox

Ignore:
Timestamp:
Aug 24, 2014 4:49:25 PM (10 years ago)
Author:
vboxsync
Message:

server_muralfbo.cpp: crServerRedirMuralDbSyncFb can be called even if crServerSupportRedirMuralFBO() is false, this will manifest as cBuffers = 0, reject these calls as we will otherwise end up dying performing zero division and later NULL pointer (hFbEntry) access. Don't call CrFbEntryRelease on a NULL hFbEntry in crServerRedirMuralFbClear.

File:
1 edited

Legend:

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

    r51320 r52485  
    120120            continue;
    121121
    122         CrFbEntryRelease(pData->hFb, pData->hFbEntry);
    123         pData->hFbEntry = NULL;
     122        if (pData->hFbEntry != NULL)
     123        {
     124            CrFbEntryRelease(pData->hFb, pData->hFbEntry);
     125            pData->hFbEntry = NULL;
     126        }
    124127
    125128        for (j = 0; j < mural->cBuffers; ++j)
     
    191194    {
    192195        pData->hFb = hFb;
     196
     197        /* Guard against modulo-by-zero when calling CrFbEntryCreateForTexData
     198           below. Observed when failing to load atig6pxx.dll and similar. */
     199        if (RT_UNLIKELY(mural->cBuffers == 0))
     200        {
     201            WARN(("crServerRedirMuralDbSyncFb: cBuffers == 0 (crServerSupportRedirMuralFBO=%d)", crServerSupportRedirMuralFBO()));
     202            return VERR_NOT_SUPPORTED;
     203        }
    193204
    194205        for (uint32_t i = 0; i < mural->cBuffers; ++i)
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