vtkDataArray::Size wrong after call to IDirect3DDevice9::CreateDevice
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
This is a follow-up to a problem I already reported to the mailing list in mid-2005, but got no helpful response:
http://public.kitware.com/pipermail/vtkusers/2005-June/080188.html
In the attached example program,
pImageReslice->Update(); // Line 86
seems to put an invalid value (always 1) into its vtkDataArray::Size if CREATE_DEVICE_BEFORE_UPDATE is defined, which leads to a crash in
memcpy(data,output,widthheightsizeof(float)); // Line 96
as the array's size is not widthheightsizeof(float) but 1*sizeof(float). If only CREATE_DEVICE_AFTER_UPDATE is defined, or neither are defined, the program just works fine. So for some reason pImageReslice->Update() seems to do something different than it does if no D3D device is created before.
This was tested on Windows XP SP2, 32-Bit, using VS2005 and DXSDK 9.0c (June 2007) with VTK 5.0.4.