VirtualBox

Changeset 87118 in vbox for trunk


Ignore:
Timestamp:
Dec 24, 2020 10:09:55 AM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
142004
Message:

DevVGA: Removed unused code, better errors messages for bogus custom modes (see bugref:9876).

File:
1 edited

Legend:

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

    r87105 r87118  
    824824}
    825825
    826 # ifdef SOME_UNUSED_FUNCTION
    827 /* Calculate line width in pixels based on bit depth and pitch. */
    828 static uint32_t calc_line_width(uint16_t bpp, uint32_t pitch)
    829 {
    830     uint32_t    width;
    831 
    832     if (bpp <= 4)
    833         width = pitch << 1;
    834     else
    835         width = pitch / ((bpp + 7) >> 3);
    836 
    837     return width;
    838 }
    839 # endif
    840 
    841826static void recalculate_data(PVGASTATE pThis)
    842827{
     
    849834    if (!cbLinePitch)
    850835        cbLinePitch      = calc_line_pitch(cBPP, cX);
    851     Assert(cbLinePitch != 0);
     836    if (!cbLinePitch)
     837        return;
    852838    uint32_t cVirtHeight = pThis->vram_size / cbLinePitch;
    853839    uint16_t offX        = pThis->vbe_regs[VBE_DISPI_INDEX_X_OFFSET];
     
    68636849        if (reqSize >= pThis->vram_size)
    68646850            continue;
     6851        if (!reqSize)
     6852            continue;
    68656853        if (   mode_info_list[i].info.XResolution > maxBiosXRes
    68666854            || mode_info_list[i].info.YResolution > maxBiosYRes)
     
    69246912                {
    69256913                    AssertMsgFailed(("Configuration error: Invalid mode data '%s' for '%s'! cBits=%d\n", pszExtraData, szExtraDataKey, cBits));
     6914                    return VERR_VGA_INVALID_CUSTOM_MODE;
     6915                }
     6916                if (!cx || !cy)
     6917                {
     6918                    AssertMsgFailed(("Configuration error: Invalid mode data '%s' for '%s'! cx=%u, cy=%u\n", pszExtraData, szExtraDataKey, cx, cy));
    69266919                    return VERR_VGA_INVALID_CUSTOM_MODE;
    69276920                }
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