VirtualBox

Changeset 53535 in vbox


Ignore:
Timestamp:
Dec 13, 2014 7:11:26 PM (10 years ago)
Author:
vboxsync
Message:

DevVGA: fixed loading of pre-VGA_SAVEDSTATE_VERSION_MODE_HINTS saved states

File:
1 edited

Legend:

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

    r53529 r53535  
    18301830                    AssertRCReturn(rc, rc);
    18311831                }
    1832                 uint32_t cModeHints, cbModeHints;
    1833                 rc = SSMR3GetU32 (pSSM, &cModeHints);
    1834                 AssertRCReturn(rc, rc);
    1835                 rc = SSMR3GetU32 (pSSM, &cbModeHints);
    1836                 AssertRCReturn(rc, rc);
    1837                 memset(&pCtx->aModeHints, ~0, sizeof(pCtx->aModeHints));
    1838                 unsigned iHint;
    1839                 for (iHint = 0; iHint < cModeHints; ++iHint)
    1840                 {
    1841                     if (   cbModeHints <= sizeof(VBVAMODEHINT)
    1842                         && iHint < RT_ELEMENTS(pCtx->aModeHints))
    1843                         rc = SSMR3GetMem(pSSM, &pCtx->aModeHints[iHint],
    1844                                          cbModeHints);
    1845                     else
    1846                         rc = SSMR3Skip(pSSM, cbModeHints);
     1832
     1833                if (u32Version >= VGA_SAVEDSTATE_VERSION_MODE_HINTS)
     1834                {
     1835                    uint32_t cModeHints, cbModeHints;
     1836                    rc = SSMR3GetU32 (pSSM, &cModeHints);
    18471837                    AssertRCReturn(rc, rc);
     1838                    rc = SSMR3GetU32 (pSSM, &cbModeHints);
     1839                    AssertRCReturn(rc, rc);
     1840                    memset(&pCtx->aModeHints, ~0, sizeof(pCtx->aModeHints));
     1841                    unsigned iHint;
     1842                    for (iHint = 0; iHint < cModeHints; ++iHint)
     1843                    {
     1844                        if (   cbModeHints <= sizeof(VBVAMODEHINT)
     1845                            && iHint < RT_ELEMENTS(pCtx->aModeHints))
     1846                            rc = SSMR3GetMem(pSSM, &pCtx->aModeHints[iHint],
     1847                                             cbModeHints);
     1848                        else
     1849                            rc = SSMR3Skip(pSSM, cbModeHints);
     1850                        AssertRCReturn(rc, rc);
     1851                    }
    18481852                }
    18491853            }
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