Changeset 34674 in vbox
- Timestamp:
- Dec 3, 2010 12:57:15 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Graphics/DevVGA_VBVA.cpp
r34667 r34674 1797 1797 1798 1798 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 1799 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; 1810 1805 LogFlowFunc(("VBVA_INFO_SCREEN: [%d] @%d,%d %dx%d, line 0x%x, BPP %d, flags 0x%x\n", 1811 1806 pScreen->u32ViewIndex, pScreen->i32OriginX, pScreen->i32OriginY, … … 1815 1810 if ( pScreen->u32ViewIndex < RT_ELEMENTS (pCtx->aViews) 1816 1811 && pScreen->u16BitsPerPixel <= 32 1817 && offBegin >= 0 1812 && pScreen->u32Width <= UINT16_MAX 1813 && pScreen->u32Height <= UINT16_MAX 1814 && pScreen->u32LineSize <= UINT16_MAX * 4 1818 1815 && offEnd < pView->u32MaxScreenSize) 1819 1816 { … … 1822 1819 else 1823 1820 { 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", 1825 1822 (unsigned long)pScreen->u32ViewIndex, 1826 (long)pScreen->i32OriginX,1827 (long)pScreen->i32OriginY,1828 1823 (unsigned long)pScreen->u32Width, 1829 1824 (unsigned long)pScreen->u32Height, 1830 1825 (unsigned long)pScreen->u32LineSize, 1831 1826 (unsigned long)pScreen->u16BitsPerPixel, 1827 (unsigned long)pScreen->u32StartOffset, 1832 1828 (unsigned long)pView->u32MaxScreenSize)); 1833 1829 rc = VERR_INVALID_PARAMETER;
Note:
See TracChangeset
for help on using the changeset viewer.