Skip to content

Commit

Permalink
mapserver: don't crash when WIDTH or HEIGHT are missing.
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@15102 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Jan 28, 2011
1 parent 703d049 commit 030f8ab
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/mapserver/qgis_map_serv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ void printRequestInfos()
#ifdef QGSMSDEBUG
//print out some infos about the request
QgsMSDebugMsg( "************************new request**********************" )
QgsMSDebugMsg( QDateTime::currentDateTime().toString( "yyyy-mm-dd hh:mm:ss" ) );
QgsMSDebugMsg( QDateTime::currentDateTime().toString( "yyyy-MM-dd hh:mm:ss" ) );

if ( getenv( "REMOTE_ADDR" ) != NULL )
{
Expand Down
18 changes: 12 additions & 6 deletions src/mapserver/qgswmsserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -715,10 +715,13 @@ QImage* QgsWMSServer::createImage( int width, int height ) const
{
width = 0; //width parameter is mandatory
}
width = wit->second.toInt( &conversionSuccess );
if ( !conversionSuccess )
else
{
width = 0;
width = wit->second.toInt( &conversionSuccess );
if ( !conversionSuccess )
{
width = 0;
}
}
}

Expand All @@ -729,10 +732,13 @@ QImage* QgsWMSServer::createImage( int width, int height ) const
{
height = 0; //height parameter is mandatory
}
height = hit->second.toInt( &conversionSuccess );
if ( !conversionSuccess )
else
{
height = 0;
height = hit->second.toInt( &conversionSuccess );
if ( !conversionSuccess )
{
height = 0;
}
}
}

Expand Down

0 comments on commit 030f8ab

Please sign in to comment.