Close
I've noticed that I get a bad allocation if I have done a lot of processing and filtering on the image before I run Greycstoration (I have Photoshop set to 100 History States and 8 Cache Levels). Saving the image, closing and then re-opening it seems to make bad allocation go away.

Also today when I was trying to filter this one image, I kept on getting runtime errors once Greycstoration got half-way through filtering. I tried some other images and they were fine but it seems to hate this one image for some reason. Tried many different settings and 4 different versions of your plugin and the same thing happened with all of them. The Gimp plugin and standalone executable had no issues.
Error:
http://img201.imageshack.us/img201/8530/errorgf8.png
Image that causes the error:
http://moe.imouto.org/post/show/49374/

Has anything changed in the Photoshop CS4 SDK ( http://download.macromedia.com/pub/developer/photoshop/sdk/adobe_photoshop_cs4_sdk_win.zip ) from the CS2 SDK you seem to be using? If so, maybe try compiling it with CS4 SDK and we can see it that fixes it?