Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


hello,
I have quickly investigated the crash in fdo#45779 when saving an impress document.

The reason of the crash is in basegfx/inc/basegfx/point/b2dpoint.hxx (line 82) where this is called:

2DPoint::B2DPoint (this=0xbfffc850, rPoint=...)
      :   B2DTuple(rPoint)
(from back-trace)

It turns out that in this case, rPoint is 0x0, the null pointer.
and B2DTuple does not support it

B2DTuple(const B2DTuple& rTup)
        :   mfX( rTup.mfX ),
            mfY( rTup.mfY )
{}

Here you dereference the null pointer, which crash.

Ok, the basic attitude would be to let B2DTuple be Null-pointer consistent: (checking that rTup is not NULL), but is it really a good idea?

What is a NULL B2DTuple ?

Or should the caller (this is called due to basegfx/source/polygon/b2dpolygon.cxx:1257) take care of the case, returning either the value, ... or NULL ?

B2DPoint B2DPolygon::getB2DPoint(sal_uInt32 nIndex) const
    {
        OSL_ENSURE(nIndex < mpPolygon->count(), "B2DPolygon a
        return mpPolygon->getPoint(nIndex);
    }


Or should I look higher in the hierarchy, saying that a NULL point in a B2DPolygon has nothing to do and disallow it ?

As far as I could seee, this polygon had 4 elements / points, all with NULL data at the time of the crash :-/

What would be the right (and most meaningfull) approach ?

Thanks & regards
Pierre-André

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.