MantisBT - VTK
View Issue Details
0009783VTK(No Category)public2009-10-27 12:342016-08-12 09:55
itkvtk123 
Kitware Robot 
normalcrashalways
closedmoved 
 
 
0009783: Crash in vtkline.cxx - access uninitialized data
Crash in vtkline.cxx - access uninitialized data (line 113 "Determine line vectors")
How to reproduce the bug (first way):
1. Zoom out using the mousewheel to see the entire image.
2. Left click inside image area to place first contour point
3. Right click outside image area to cancel/finish contour operation
4. Press Mousewheel and drag image -> crash

How to reproduce the bug (second way):
1. Zoom out using the mousewheel to see the entire image.
2. Left click inside image area to place first contour point
3. Right click outside image area to cancel/finish contour operation
4. Hold Ctrl, Left Click Mouse and drag to rotate image
5. Left click inside image area to place second contour point -> crash
Minimal Code:

#include "vtkImageViewer2.h"
#include "vtkRenderWindowInteractor.h"
#include "vtkContourWidget.h"
#include "vtkPNGReader.h"
#include "vtkOrientedGlyphContourRepresentation.h"
#include "vtkImageActorPointPlacer.h"

int main(int argc, char*argv[])
{
    //Setting Up Viewer
    vtkImageViewer2* viewer = vtkImageViewer2::New();
    vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();
    viewer->SetupInteractor(iren);

    //Read Image
    vtkPNGReader* reader = vtkPNGReader::New();
    reader->SetFileName("BrainProtonDensitySlice.png");
    viewer->SetInput(reader->GetOutput());

    //Initialize Widget
    vtkContourWidget* widget = vtkContourWidget::New();
    widget->SetInteractor(iren);
    vtkOrientedGlyphContourRepresentation *rep = vtkOrientedGlyphContourRepresentation::New();
    widget->SetRepresentation(rep);

    //Initialize Point Placer
    vtkImageActorPointPlacer* pointPlacer = vtkImageActorPointPlacer::New();
    pointPlacer->SetImageActor(viewer->GetImageActor());
    rep->SetPointPlacer(pointPlacer);

    //Start Interaction
    viewer->Render();
    widget->On();
    iren->Start();

    return 0;
}
No tags attached.
Issue History
2009-10-27 12:34itkvtk123New Issue
2010-04-20 17:28David DoriaNote Added: 0020308
2011-06-16 13:11Zack GalbreathCategory => (No Category)
2016-08-12 09:55Kitware RobotNote Added: 0037115
2016-08-12 09:55Kitware RobotStatusexpired => closed
2016-08-12 09:55Kitware RobotResolutionopen => moved
2016-08-12 09:55Kitware RobotAssigned To => Kitware Robot

Notes
(0020308)
David Doria   
2010-04-20 17:28   
When does it crash? It seems to work fine for me. If you add

viewer->Delete();
    iren->Delete();
    reader->Delete();
    widget->Delete();
    rep->Delete();
    pointPlacer->Delete();

there are no memory leaks reported.
(0037115)
Kitware Robot   
2016-08-12 09:55   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current VTK Issues page linked in the banner at the top of this page.