[vtkusers] vtkPLY exit

James Hargrave jhargrave at photomodeler.com
Thu Nov 15 15:05:31 EST 2007


Hey Sean (& Mathieu),

I applied the patch that Mathieu suggested (I see you've added it to CVS
now) and it's resolved the issue I was having with some .ply files (eg. the
bunny).

However I still see a different crash if I take a totally invalid .ply file
(eg. if I rename the "bunny.ply.gz" to "bunny.ply.gz.ply" and try to load
it).

That crash is in vtkPLY::ply_open_for_reading here:

  /* create the PlyFile data structure */

  plyfile = vtkPLY::ply_read (fp, nelems, elem_names);

  /* determine the file type and version */
  *file_type = plyfile->file_type;  // xxx Crash is here.  plyfile is NULL.
  *version = plyfile->version;
  
Not a huge issue but I figured I'd pass the information along.

Thanks a ton for the patch (and the heads up about it).

Cheers,
- James


> -----Original Message-----
> From: Sean McBride [mailto:sean at rogue-research.com] 
> Sent: November 15, 2007 7:47 AM
> To: James Hargrave; vtkusers at vtk.org
> Subject: Re: [vtkusers] vtkPLY exit
> 
> On 11/7/07 1:58 PM, James Hargrave said:
> 
> >Maybe it's one of my build settings or something but vtkPLY has a 
> >number of cases where it calls exit(-1).
> >
> >Is there a reason for this?  A failed return code or an 
> exception would 
> >seem much more useful.  As it is now when an invalid .ply file is 
> >loaded into my application it shuts down instead of explaining the 
> >issue to the user and just aborting the load of the file.
> 
> I agree.  Calling exit() like that is evil.  Please file a 
> bug at <http://public.kitware.com/Bug>.  Also, my colleague 
> Mathieu has improved the PLY reader and it can now read more 
> PLY files, you might want to try VTK from CVS to see if this 
> helps you.
> 
> --
> ____________________________________________________________
> Sean McBride, B. Eng                 sean at rogue-research.com
> Rogue Research                        www.rogue-research.com 
> Mac Software Developer              Montréal, Québec, Canada
> 
> 





More information about the vtkusers mailing list