VirtualBox

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


Ignore:
Timestamp:
Oct 7, 2024 10:07:57 AM (6 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
165012
Message:

3D: Replacing memcpy with memmove to workaround possible Src and Dst buffers overlapping. bugref:10580

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA-cmd.cpp

    r106221 r106224  
    83648364            if (pbDst - pbSrc < cbSrcPitch * cHeight)
    83658365            {
    8366                 LogRelMax(4, ("Src buffer 0x%p overlaps Dst buffer 0x%p\n", pbSrc, pbDst));
    8367                 return VERR_INVALID_PARAMETER;
     8366                LogRelMax(8, ("Src buffer 0x%p overlaps Dst buffer 0x%p, cbSrcPitch %d, cbDstPitch %d, cbWidth %u, cHeight %u\n",
     8367                    pbSrc, pbDst, cbSrcPitch, cbDstPitch, cbWidth, cHeight));
    83688368            }
    83698369        }
     
    83728372            if (pbSrc - pbDst < cbDstPitch * cHeight)
    83738373            {
    8374                 LogRelMax(4, ("Dst buffer 0x%p overlaps Src buffer 0x%p\n", pbDst, pbSrc));
    8375                 return VERR_INVALID_PARAMETER;
     8374                LogRelMax(8, ("Dst buffer 0x%p overlaps Src buffer 0x%p, cbSrcPitch %d, cbDstPitch %d, cbWidth %u, cHeight %u\n",
     8375                    pbDst, pbSrc, cbSrcPitch, cbDstPitch, cbWidth, cHeight));
    83768376            }
    83778377        }
    83788378        else
    83798379        {
    8380             LogRelMax(4, ("Dst and Src buffers are both start at 0x%p\n", pbDst));
    8381             return VERR_INVALID_PARAMETER;
     8380            LogRelMax(8, ("Src and Dst buffers are both start at 0x%p, cbSrcPitch %d, cbDstPitch %d, cbWidth %u, cHeight %u\n",
     8381                pbSrc, cbSrcPitch, cbDstPitch, cbWidth, cHeight));
    83828382        }
    83838383
     
    83868386        {
    83878387            /* Entire scanlines, positive pitch. */
    8388             memcpy(pbDst, pbSrc, cbWidth * cHeight);
     8388            memmove(pbDst, pbSrc, cbWidth * cHeight);
    83898389        }
    83908390        else
     
    83928392            for (uint32_t i = 0; i < cHeight; ++i)
    83938393            {
    8394                 memcpy(pbDst, pbSrc, cbWidth);
     8394                memmove(pbDst, pbSrc, cbWidth);
    83958395
    83968396                pbDst += cbDstPitch;
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