VirtualBox

忽略:
時間撮記:
2010-12-2 下午11:08:24 (14 年 以前)
作者:
vboxsync
訊息:

Devices/Graphics: check requested screen sizes to be sure they fit in the available memory

檔案:
修改 1 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/Devices/Graphics/DevVGA_VBVA.cpp

    r34490 r34667  
    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;
     1801            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;
    17991810            LogFlowFunc(("VBVA_INFO_SCREEN: [%d] @%d,%d %dx%d, line 0x%x, BPP %d, flags 0x%x\n",
    18001811                         pScreen->u32ViewIndex, pScreen->i32OriginX, pScreen->i32OriginY,
     
    18021813                         pScreen->u32LineSize,  pScreen->u16BitsPerPixel, pScreen->u16Flags));
    18031814
    1804             if (pScreen->u32ViewIndex < RT_ELEMENTS (pCtx->aViews))
     1815            if (   pScreen->u32ViewIndex < RT_ELEMENTS (pCtx->aViews)
     1816                && pScreen->u16BitsPerPixel <= 32
     1817                && offBegin >= 0
     1818                && offEnd < pView->u32MaxScreenSize)
    18051819            {
    18061820                vbvaResize (pVGAState, &pCtx->aViews[pScreen->u32ViewIndex], pScreen);
     
    18081822            else
    18091823            {
    1810                 Log(("View index too large %d!!!\n",
    1811                      pScreen->u32ViewIndex));
     1824                Log(("VBVA_INFO_SCREEN [%lu]: bad data: @%ld,%ld %lux%lu, line 0x%lx, BPP %u, max screen size %lu\n",
     1825                         (unsigned long)pScreen->u32ViewIndex,
     1826                         (long)pScreen->i32OriginX,
     1827                         (long)pScreen->i32OriginY,
     1828                         (unsigned long)pScreen->u32Width,
     1829                         (unsigned long)pScreen->u32Height,
     1830                         (unsigned long)pScreen->u32LineSize,
     1831                         (unsigned long)pScreen->u16BitsPerPixel,
     1832                         (unsigned long)pView->u32MaxScreenSize));
    18121833                rc = VERR_INVALID_PARAMETER;
    18131834            }
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette