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é
_______________________________________________
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice

Reply via email to