VirtualBox

Changeset 29542 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
May 17, 2010 1:41:20 PM (15 years ago)
Author:
vboxsync
Message:

Main: better handle null shapes

Location:
trunk/src/VBox/Frontends
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp

    r29518 r29542  
    107107        com::SafeArray <BYTE> aShape(ComSafeArrayInArg (pShape));
    108108        size_t cbShapeSize = aShape.size();
    109         shape.resize(cbShapeSize);
    110         ::memcpy(shape.raw(), aShape.raw(), cbShapeSize);
     109        if (cbShapeSize > 0)
     110        {
     111            shape.resize(cbShapeSize);
     112            ::memcpy(shape.raw(), aShape.raw(), cbShapeSize);
     113        }
    111114    }
    112115
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleView.cpp

    r29518 r29542  
    216216        com::SafeArray <BYTE> aShape(ComSafeArrayInArg (pShape));
    217217        size_t cbShapeSize = aShape.size();
    218         shape.resize(cbShapeSize);
    219         ::memcpy(shape.raw(), aShape.raw(), cbShapeSize);
     218        if (cbShapeSize > 0)
     219        {
     220            shape.resize(cbShapeSize);
     221            ::memcpy(shape.raw(), aShape.raw(), cbShapeSize);
     222        }
    220223    }
    221224    ~MousePointerChangeEvent()
     
    228231    uint width() const { return w; }
    229232    uint height() const { return h; }
    230     const uchar *shapeData() const { return shape.raw(); }
     233    const uchar *shapeData() const { return shape.size() > 0 ? shape.raw() : NULL; }
    231234private:
    232235    bool vis, alph;
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r29518 r29542  
    6060    {
    6161        com::SafeArray <BYTE> aShape(ComSafeArrayInArg (pShape));
    62         size_t cbShapeSize = aShape.size();
    63         m_shape.resize(cbShapeSize);
    64         ::memcpy(m_shape.raw(), aShape.raw(), cbShapeSize);
     62        size_t cbShapeSize = aShape.size();       
     63        if (cbShapeSize > 0)
     64        {
     65            m_shape.resize(cbShapeSize);
     66            ::memcpy(m_shape.raw(), aShape.raw(), cbShapeSize);
     67        }
    6568    }
    6669
     
    7578    uint width() const { return m_uWidth; }
    7679    uint height() const { return m_uHeight; }
    77     const uchar *shapeData() const { return m_shape.raw(); }
     80    const uchar *shapeData() const { return m_shape.size() > 0 ? m_shape.raw() : NULL; }
    7881
    7982private:
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