Skip to content

Commit 030f8ab

Browse files
author
jef
committedJan 28, 2011
mapserver: don't crash when WIDTH or HEIGHT are missing.
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@15102 c8812cc2-4d05-0410-92ff-de0c093fc19c

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed
 

‎src/mapserver/qgis_map_serv.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ void printRequestInfos()
4949
#ifdef QGSMSDEBUG
5050
//print out some infos about the request
5151
QgsMSDebugMsg( "************************new request**********************" )
52-
QgsMSDebugMsg( QDateTime::currentDateTime().toString( "yyyy-mm-dd hh:mm:ss" ) );
52+
QgsMSDebugMsg( QDateTime::currentDateTime().toString( "yyyy-MM-dd hh:mm:ss" ) );
5353

5454
if ( getenv( "REMOTE_ADDR" ) != NULL )
5555
{

‎src/mapserver/qgswmsserver.cpp

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -715,10 +715,13 @@ QImage* QgsWMSServer::createImage( int width, int height ) const
715715
{
716716
width = 0; //width parameter is mandatory
717717
}
718-
width = wit->second.toInt( &conversionSuccess );
719-
if ( !conversionSuccess )
718+
else
720719
{
721-
width = 0;
720+
width = wit->second.toInt( &conversionSuccess );
721+
if ( !conversionSuccess )
722+
{
723+
width = 0;
724+
}
722725
}
723726
}
724727

@@ -729,10 +732,13 @@ QImage* QgsWMSServer::createImage( int width, int height ) const
729732
{
730733
height = 0; //height parameter is mandatory
731734
}
732-
height = hit->second.toInt( &conversionSuccess );
733-
if ( !conversionSuccess )
735+
else
734736
{
735-
height = 0;
737+
height = hit->second.toInt( &conversionSuccess );
738+
if ( !conversionSuccess )
739+
{
740+
height = 0;
741+
}
736742
}
737743
}
738744

0 commit comments

Comments
 (0)
Please sign in to comment.