Vortice.Windows: Crash in IWICImagingFactory.CreateStream

Calling IWICImagingFactory.CreateStream simply never succeeds: it crashes with either an access violation or a null reference exception. This might be a regression, since I don’t remember having issues like that with an earlier version of Vortice (it was probably 1.8.x).

Here is a repro project, but really it’s just 3 lines of code:

using FileStream stream = File.OpenRead("LuLu.png");
using var wicFactory = new IWICImagingFactory();
using IWICStream wicStream = wicFactory.CreateStream(stream);

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 41 (41 by maintainers)

Most upvoted comments

Just FYI, this is how you would do this using SharpDX. Needless to say, it doesn’t crash.

 using var wicStream = new WICStream(_wicFactory, stream);
 using var decoder = new BitmapDecoder(_wicFactory, wicStream, DecodeOptions.CacheOnDemand);

@amerkoleci I work on this almost every day. The changes are huge, I’m trying to simplify logic without breaking anything.

This has to be fixed on automatic shadow codegen as there can be different automatic callback shadows doing so

I’ve confirmed reverting it fixes the issue with latest versions of everything.