VirtualBox

Changeset 34674 in vbox


Ignore:
Timestamp:
Dec 3, 2010 12:57:15 AM (14 years ago)
Author:
vboxsync
Message:

Devices/Graphics: r68469, fixed

File:
1 edited

Legend:

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

    r34667 r34674  
    17971797
    17981798            VBVAINFOSCREEN *pScreen = (VBVAINFOSCREEN *)pvBuffer;
    1799             int64_t cLastX = (int64_t)pScreen->u32Width + pScreen->i32OriginX;
    1800             int64_t cLastY = (int64_t)pScreen->u32Height + pScreen->i32OriginY;
    18011799            VBVAINFOVIEW *pView = &pCtx->aViews[pScreen->u32ViewIndex].view;
    1802             /* Calculate the offsets of the beginning and the end of the screen
    1803              * so we can make sure they are inside the view.  We assume that
    1804              * screen rollover is not implemented. */
    1805             int64_t offBegin =   pScreen->i32OriginY * pScreen->u32LineSize
    1806                                +   pScreen->i32OriginX
    1807                                  * pScreen->u16BitsPerPixel / 8;
    1808             int64_t offEnd   =   cLastY * pScreen->u32LineSize
    1809                                + cLastX * pScreen->u16BitsPerPixel / 8;
     1800            /* Calculate the offset of the  end of the screen so we can make
     1801             * sure it is inside the view.  I assume that screen rollover is not
     1802             * implemented. */
     1803            int64_t offEnd =   (int64_t)pScreen->u32Height * pScreen->u32LineSize
     1804                             + pScreen->u32Width + pScreen->u32StartOffset;
    18101805            LogFlowFunc(("VBVA_INFO_SCREEN: [%d] @%d,%d %dx%d, line 0x%x, BPP %d, flags 0x%x\n",
    18111806                         pScreen->u32ViewIndex, pScreen->i32OriginX, pScreen->i32OriginY,
     
    18151810            if (   pScreen->u32ViewIndex < RT_ELEMENTS (pCtx->aViews)
    18161811                && pScreen->u16BitsPerPixel <= 32
    1817                 && offBegin >= 0
     1812                && pScreen->u32Width <= UINT16_MAX
     1813                && pScreen->u32Height <= UINT16_MAX
     1814                && pScreen->u32LineSize <= UINT16_MAX * 4
    18181815                && offEnd < pView->u32MaxScreenSize)
    18191816            {
     
    18221819            else
    18231820            {
    1824                 Log(("VBVA_INFO_SCREEN [%lu]: bad data: @%ld,%ld %lux%lu, line 0x%lx, BPP %u, max screen size %lu\n",
     1821                Log(("VBVA_INFO_SCREEN [%lu]: bad data: %lux%lu, line 0x%lx, BPP %u, start offset %lu, max screen size %lu\n",
    18251822                         (unsigned long)pScreen->u32ViewIndex,
    1826                          (long)pScreen->i32OriginX,
    1827                          (long)pScreen->i32OriginY,
    18281823                         (unsigned long)pScreen->u32Width,
    18291824                         (unsigned long)pScreen->u32Height,
    18301825                         (unsigned long)pScreen->u32LineSize,
    18311826                         (unsigned long)pScreen->u16BitsPerPixel,
     1827                         (unsigned long)pScreen->u32StartOffset,
    18321828                         (unsigned long)pView->u32MaxScreenSize));
    18331829                rc = VERR_INVALID_PARAMETER;
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