VirtualBox

Changeset 71588 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Mar 31, 2018 1:47:29 PM (7 years ago)
Author:
vboxsync
Message:

DevVGA_VDMA.cpp: Added missing+buggy bits from ?bugref:9054.

File:
1 edited

Legend:

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

    r71194 r71588  
    25592559        {
    25602560            if (   cbDstLine <= cbVRamSize
    2561                 && (uintptr_t)pbSrcStart - (uintptr_t)pbRam <= cbVRamSize - cbDstLine
     2561                && (uintptr_t)pbDstStart - (uintptr_t)pbRam <= cbVRamSize - cbDstLine
    25622562                && (uintptr_t)pbSrcStart - (uintptr_t)pbRam <= cbVRamSize - cbDstLine)
    25632563                memcpy(pbDstStart, pbSrcStart, cbDstLine);
     
    27152715    uint32_t    cbTransfered = 0;
    27162716    int         rc           = VINF_SUCCESS;
     2717
     2718    if (pTransfer->fFlags & VBOXVDMACMD_DMA_BPB_TRANSFER_F_SRC_VRAMOFFSET)
     2719    {
     2720        if (RT_LIKELY(   pTransfer->cbTransferSize <= pVGAState->vram_size
     2721                      && pTransfer->Src.offVramBuf <= pVGAState->vram_size - pTransfer->cbTransferSize))
     2722        { /* likely */ }
     2723        else
     2724            return VERR_INVALID_PARAMETER;
     2725    }
     2726
     2727    if (pTransfer->fFlags & VBOXVDMACMD_DMA_BPB_TRANSFER_F_DST_VRAMOFFSET)
     2728    {
     2729        if (RT_LIKELY(   pTransfer->cbTransferSize <= pVGAState->vram_size
     2730                      && pTransfer->Dst.offVramBuf <= pVGAState->vram_size - pTransfer->cbTransferSize))
     2731        { /* likely */ }
     2732        else
     2733            return VERR_INVALID_PARAMETER;
     2734    }
     2735
    27172736    do
    27182737    {
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