VirtualBox

Changeset 105644 in vbox


Ignore:
Timestamp:
Aug 9, 2024 11:24:24 PM (4 months ago)
Author:
vboxsync
Message:

Devices/Graphics: clamp vertex buffer stride

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-dx-dx11.cpp

    r105575 r105644  
    60006000        }
    60016001#endif
     6002        PVMSVGA3DSURFACE pSurface = NULL;
    60026003        ID3D11Buffer *pBuffer = NULL;
    60036004        if (pBufferPipeline->bufferId != SVGA3D_INVALID_ID)
    60046005        {
    6005             PVMSVGA3DSURFACE pSurface;
    60066006            ID3D11Resource *pResource;
    60076007            int rc = dxEnsureResource(pThisCC, pBufferPipeline->bufferId, &pSurface, &pResource);
     
    60176017        {
    60186018            LogFunc(("vb[%u]: %p\n", i, pBuffer));
    6019             paStride[i] = pBufferPipeline->stride;
    6020             paOffset[i] = pBufferPipeline->offset;
     6019
     6020            /* DX11 supports stride up tp 2048. Ignore large values (> 40000) that Ubuntu guest might send. */
     6021            paStride[i] = pBufferPipeline->stride <= 2048 ? pBufferPipeline->stride : 0;
     6022
     6023            if (   paStride[i] <= pSurface->paMipmapLevels[0].cbSurface
     6024                && pBufferPipeline->offset <= pSurface->paMipmapLevels[0].cbSurface - paStride[i])
     6025                paOffset[i] = pBufferPipeline->offset;
     6026            else
     6027            {
     6028                paStride[i] = 0;
     6029                paOffset[i] = 0;
     6030            }
    60216031        }
    60226032        else
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