Current Position:Home > 16-bit import plug-in

16-bit import plug-in

Update:11-30Source: network consolidation
I'm trying to write an import plug-in for 16-bit data, but it keeps crashing.  I have it working for 8-bit, but when I switch to 16-bit...kerflooy.
I've changed the imageMode to plugInModeGray16, set the depth to16 and the colBytes to 2, which I use in the calculation for the size of buffer to allocate.  It gets all the way through to finalize then craps out.  Are there any settings I'm missing?

The Best Answer

Most likely you missed on calculating one of the values, leading to an access outside of the buffer - which means an access violation and crash.