decai
Topic Author
Posts: 31
Joined: 06 Jul 2016, 18:19

BitmapSource::Create from MFC CImage Bits crashed on x64

04 Apr 2019, 13:48

hi,

We add bellow code in HelloWorld sample for test create BitmapSource from MFC CImage.
When we build x86 is ok, when we changed to x64 the app crashed as "Exception thrown at 0x00007FFA47395280 (Noesis.dll) in Samples.HelloWorld.exe: 0xC0000005: Access violation reading location 0x000002380DFF52B3." at the line BitmapSource::Create. Thanks.
CImage *image = new CImage();
HRESULT sr = image->Load("d:\\1.png");
if (sr == S_OK) {
	int imageWidth = image->GetWidth();
	int imageHeight = image->GetHeight();
	const void *data = image->GetBits();
	int pitch = image->GetPitch();

	BitmapSource::Format bitmapFormat = Noesis::BitmapSource::Format_BGRA8;
	auto imageSource = BitmapSource::Create(imageWidth, imageHeight, 0, 0, (uint8_t*)data, pitch, bitmapFormat);
	if (imageSource) { 
            printf("image source create ok");
        }
}
1.png
1.png (7.17 KiB) Viewed 337 times

Tags:
 
User avatar
sfernandez
Site Admin
Posts: 1915
Joined: 22 Dec 2011, 19:20

Re: BitmapSource::Create from MFC CImage Bits crashed on x64

05 Apr 2019, 11:59

Hi,

This could be a problem with the data format (the stride maybe), that is leading to read wrong memory address.
Could you please create a ticket in our bugtracker and attach the sample project, or a mini-dump at least, so we can debug it?

Thanks for your collaboration.
 
decai
Topic Author
Posts: 31
Joined: 06 Jul 2016, 18:19

Re: BitmapSource::Create from MFC CImage Bits crashed on x64

05 Apr 2019, 13:48

 
User avatar
sfernandez
Site Admin
Posts: 1915
Joined: 22 Dec 2011, 19:20

Re: BitmapSource::Create from MFC CImage Bits crashed on x64

05 Apr 2019, 13:57

Thanks, we'll take a look as soon as possible.

Who is online

Users browsing this forum: Roest and 1 guest