Bug 363845

Summary: Use of pointer after deallocation
Product: [Applications] krita Reporter: maddin200
Component: ToolsAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: All   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description maddin200 2016-06-02 15:09:08 UTC
krita-master\libs\vectorimage\libwmf\WmfPainterBackend.cpp line 84
Code:
  if (mPainter && mIsInternalPainter)
        delete mPainter;

    mTarget = mPainter->device();

Reproducible: Always




better:

if (mPainter != NULL)
{
  mTarget = mPainter->device();
}
Comment 1 Halla Rempt 2016-06-07 07:36:56 UTC
Git commit 6bc432f8d4e70e515cd0ab2221cc5dd35fe10d27 by Boudewijn Rempt.
Committed on 07/06/2016 at 07:15.
Pushed by rempt into branch 'krita/3.0'.

No idea what Inge actually was doing here, it looks like he
stopped in the middle of a refactoring. But since mTarget is
set in the constructor and in the copy constructor, we don't
need any of this in any case.

Maybe we should remove the whole library, who needs
wmf after all..

M  +8    -16   libs/vectorimage/libwmf/WmfPainterBackend.cpp

http://commits.kde.org/krita/6bc432f8d4e70e515cd0ab2221cc5dd35fe10d27