BitmapSource::Create from MFC CImage Bits crashed on x64
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.
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.
Code: Select all
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");
}
}
-
sfernandez
Site Admin
- Posts: 2991
- Joined:
Re: BitmapSource::Create from MFC CImage Bits crashed on x64
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.
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.
Re: BitmapSource::Create from MFC CImage Bits crashed on x64
Hi,
We just create the ticket. https://www.noesisengine.com/bugs/view.php?id=1444
We just create the ticket. https://www.noesisengine.com/bugs/view.php?id=1444
-
sfernandez
Site Admin
- Posts: 2991
- Joined:
Re: BitmapSource::Create from MFC CImage Bits crashed on x64
Thanks, we'll take a look as soon as possible.
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot] and 20 guests