[vtk-developers] [VTK 0012986]: Crash in vtkChartXY::RemovePlot

Mantis Bug Tracker mantis at public.kitware.com
Fri Mar 9 10:47:34 EST 2012


The following issue has been SUBMITTED. 
====================================================================== 
http://vtk.org/Bug/view.php?id=12986 
====================================================================== 
Reported By:                Marc Ferland
Assigned To:                
====================================================================== 
Project:                    VTK
Issue ID:                   12986
Category:                   (No Category)
Reproducibility:            have not tried
Severity:                   minor
Priority:                   normal
Status:                     backlog
Project:                    TBD 
Type:                       crash 
Resolution:                 open
Fixed in Version:           
====================================================================== 
Date Submitted:             2012-03-09 10:47 EST
Last Modified:              2012-03-09 10:47 EST
====================================================================== 
Summary:                    Crash in vtkChartXY::RemovePlot
Description: 
The following call to RemovePlotInstance crashes because of a NULL pointer
dereference in vtkChartXY::RemovePlot():996

#include <vtkChartXY.h>
#include <vtkContextScene.h>
#include <vtkContextView.h>
#include <vtkPlotLine.h>

int main()
{
   vtkChartXY *chart = vtkChartXY::New();
   vtkPlot *line = vtkPlotLine::New();
   chart->AddPlot(line);
   chart->RemovePlotInstance(line);
   line->Delete();
   chart->Delete();
   return EXIT_SUCCESS;
}

I'm attaching a patch that fixes it for me (based on tag v5.8.0).
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2012-03-09 10:47 Marc Ferland   New Issue                                    
2012-03-09 10:47 Marc Ferland   File Added:
0001-Check-the-Scene-pointer-before-dereferencing.patch                    
======================================================================




More information about the vtk-developers mailing list