Hi,

I am getting "access violation writing location 0x00000020" on VS2010 (Windows 7) while I try to read a big tiff file into a QPixmap. The visual debugger bring me at the following location in qpixmap_raster.cpp where it says the problem is occurring:
Qt Code:
  1. {
  2. // image has alpha format but is really opaque, so try to do a
  3. // more efficient conversion
  4. if (sourceImage.format() == QImage::Format_ARGB32
  5. || sourceImage.format() == QImage::Format_ARGB32_Premultiplied)
  6. {
  7. if (!inPlace)
  8. sourceImage.detach();
  9. sourceImage.d->format = QImage::Format_RGB32; //<<=========== Debugger is here.
  10. }
  11. format = opaqueFormat;
  12. } else {
  13. format = alphaFormat;
  14. }
To copy to clipboard, switch view to plain text mode 


The above function gets called due to the following code in my source file:
Qt Code:
  1. QPixmap thisPic;
  2. if (thisPic.load(itr->second.c_str()) == false ){ //<<<==== this line causing the access violation
  3. std::cerr << "Could not load pixmap from " << itrZ->second.c_str() << std::endl;
  4. } else {
  5. ..... other code...
  6. }
To copy to clipboard, switch view to plain text mode 


The above problem is using Qt 4.8.6 on a Windows 7 box, MS VS2010, compiled in Win32 mode.

However, it turns out that the program runs fine on a Linux box, in 64 bits, using Qt 4.8.7. Also runs fine on a Windows 7 box while compiled in 64 bit mode, running Qt 5.6.

Now, granted that I am reading in large images, around 40 MB, a total of 9 images. Could be stack related issues? How should I go about finding out the exact problem? Advice?

Thanks.