question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Crash in IWICImagingFactory.CreateStream

See original GitHub issue

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);

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:41 (41 by maintainers)

github_iconTop GitHub Comments

2reactions
SomeAnonDevcommented, Apr 16, 2021

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);
1reaction
andrew-boyarshincommented, Apr 28, 2021

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

IWICImagingFactory::CreateStream method (wincodec.h)
A pointer that receives a pointer to a new IWICStream. Return value. Type: HRESULT. If this method succeeds, it returns S_OK. Otherwise, it ......
Read more >
IWICBitmapDecoder::Initialize() failing - c++
I have a byte stream pBitmap , And i need to create a decoder from it. ... is my IWICImagingFactory hr = piFactory->CreateStream(&piStream); ......
Read more >
Untitled
To create a shared file stream for an image, use the … ... My IWICImagingFactory* just cannot be released without crashing, even if...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found