VirtualBox

Ignore:
Timestamp:
Dec 5, 2011 12:34:27 PM (13 years ago)
Author:
vboxsync
Message:

wddm: DxgkDdiCreateAllocation fix

Location:
trunk/src/VBox/Additions/WINNT/Graphics/Video
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/common/wddm/VBoxMPIf.h

    r39245 r39524  
    876876}
    877877
     878#define VBOXWDDM_TRAILARRAY_MAXELEMENTSU32(_t, _af) ((uint32_t)(((~(0UL)) - (uint32_t)RT_OFFSETOF(_t, _af[0])) / RT_SIZEOFMEMB(_t, _af[0])))
     879
    878880#endif /* #ifndef ___VBoxMPIf_h___ */
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.cpp

    r39523 r39524  
    21052105        {
    21062106            WARN(("invalid number of allocations passed in, (%d), expected (%d)", pRcInfo->cAllocInfos, pCreateAllocation->NumAllocations));
     2107            return STATUS_INVALID_PARAMETER;
     2108        }
     2109
     2110        /* a check to ensure we do not get the allocation size which is too big to overflow the 32bit value */
     2111        if (VBOXWDDM_TRAILARRAY_MAXELEMENTSU32(VBOXWDDM_RESOURCE, aAllocations) < pRcInfo->cAllocInfos)
     2112        {
     2113            WARN(("number of allocations passed too big (%d), max is (%d)", pRcInfo->cAllocInfos, VBOXWDDM_TRAILARRAY_MAXELEMENTSU32(VBOXWDDM_RESOURCE, aAllocations)));
    21072114            return STATUS_INVALID_PARAMETER;
    21082115        }
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