Skip to content
Permalink
Browse files

prevent crash in QgsRasterLayer::drawMultiBandColor

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@5227 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent
mhugent committed Apr 8, 2006
1 parent 4e8221d commit 3d9fca40afb05a010206adc1a5925e3f50bc5be8
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 3d9fca4

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