Skip to content
Permalink
Browse files

prevent crash in QgsRasterLayer::drawMultiBandColor

git-svn-id: http://svn.osgeo.org/qgis/trunk@5227 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent
mhugent committed Apr 8, 2006
1 parent 2a8a3d6 commit 4e06c289d74c6054a95f00499039079feb527d4c
Showing with 11 additions and 8 deletions.
  1. +11 −8 src/raster/qgsrasterlayer.cpp
@@ -2466,12 +2466,13 @@ void QgsRasterLayer::drawMultiBandColor(QPainter * theQPainter, QgsRasterViewPor

#ifdef QGISDEBUG
QPixmap* pm = dynamic_cast<QPixmap*>(theQPainter->device());
QgsDebugMsg("QgsRasterLayer::drawMultiBandColor: theQPainter stats: ");
QgsDebugMsg("width = " + QString::number(pm->width()));
QgsDebugMsg("height = " + QString::number(pm->height()));

pm->save("/tmp/qgis-rasterlayer-drawmultibandcolor-test-a.png", "PNG");

if(pm)
{
QgsDebugMsg("QgsRasterLayer::drawMultiBandColor: theQPainter stats: ");
QgsDebugMsg("width = " + QString::number(pm->width()));
QgsDebugMsg("height = " + QString::number(pm->height()));
pm->save("/tmp/qgis-rasterlayer-drawmultibandcolor-test-a.png", "PNG");
}
#endif

// \/\/\/ - added to handle zoomed-in rasters
@@ -2514,8 +2515,10 @@ QgsDebugMsg("QgsRasterLayer::drawSingleBandGray: painting image to canvas from s

#ifdef QGISDEBUG
QgsDebugMsg("QgsRasterLayer::drawMultiBandColor: theQPainter->drawImage.");
pm->save("/tmp/qgis-rasterlayer-drawmultibandcolor-test-b.png", "PNG");

if(pm)
{
pm->save("/tmp/qgis-rasterlayer-drawmultibandcolor-test-b.png", "PNG");
}
#endif

//free the scanline memory

0 comments on commit 4e06c28

Please sign in to comment.
You can’t perform that action at this time.