Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
VTK
VTK
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 582
    • Issues 582
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 160
    • Merge Requests 160
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • VTK
  • VTKVTK
  • Issues
  • #17033

Closed
Open
Opened May 02, 2017 by Shawn Waldon@shawn.waldonDeveloper

VTK Legacy file format readers don't handle sizeof(long) correctly

Currently the writer checks the sizeof(long) and calls the correct byte-swap-to-big-endian function. But the reader assumes sizeof(long) == sizeof(int) and calls the 4-byte byte-swap-from-big-endian function leading to garbage data. This can be reproduced with any dataset with a vtkLongArray on OSX (VTK writes a file it cannot read correctly) and possibly other platforms, but this is the only place I have seen it. Attached is a file written in the XML format (which seems unaffected by this) and contains a long array which can be used to reproduce this. I'm not sure what the right behavior is. It is either a) use the data type that can fit the data that was written or b) use the data type specified in the file so that assumptions about types are correct.

mytest.vtp

Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: vtk/vtk#17033