VirtualBox

Changeset 49603 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Nov 21, 2013 2:45:47 PM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
90820
Message:

DevVGA,DisplayImpl: prevent access to invalid framebuffer.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/DisplayImpl.cpp

    r49474 r49603  
    679679    }
    680680
    681     mLastAddress = pvVRAM;
    682     mLastBytesPerLine = cbLine;
    683     mLastBitsPerPixel = bpp;
    684     mLastWidth = w;
    685     mLastHeight = h;
    686     mLastFlags = flags;
     681    if (uScreenId == VBOX_VIDEO_PRIMARY_SCREEN)
     682    {
     683        mLastAddress = pvVRAM;
     684        mLastBytesPerLine = cbLine;
     685        mLastBitsPerPixel = bpp;
     686        mLastWidth = w;
     687        mLastHeight = h;
     688        mLastFlags = flags;
     689    }
    687690
    688691    ULONG pixelFormat;
     
    729732        return VINF_VGA_RESIZE_IN_PROGRESS;
    730733    }
     734
     735    /* Framebuffer will be invalid during resize, make sure that it is not accessed. */
     736    if (uScreenId == VBOX_VIDEO_PRIMARY_SCREEN)
     737        mpDrv->pUpPort->pfnSetRenderVRAM (mpDrv->pUpPort, false);
    731738
    732739    int rc = callFramebufferResize (maFramebuffers[uScreenId].pFramebuffer, uScreenId,
     
    794801        }
    795802
     803        /* Inform VRDP server about the change of display parameters.
     804         * Must be done before calling NotifyUpdate below.
     805         */
     806        LogRelFlowFunc(("Calling VRDP\n"));
     807        mParent->consoleVRDPServer()->SendResize();
     808
    796809        /* @todo Merge these two 'if's within one 'if (!pFBInfo->pFramebuffer.isNull())' */
    797810        if (uScreenId == VBOX_VIDEO_PRIMARY_SCREEN && !pFBInfo->pFramebuffer.isNull())
     
    864877        }
    865878#endif /* DEBUG_sunlover */
    866 
    867         /* Inform VRDP server about the change of display parameters. */
    868         LogRelFlowFunc(("Calling VRDP\n"));
    869         mParent->consoleVRDPServer()->SendResize();
    870879
    871880#if defined(VBOX_WITH_HGCM) && defined(VBOX_WITH_CROGL)
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