avoid potential zero division error (floating point exception) if image width and heigh == 0 (likely to happen when layer srs = 4326 and map srs = 900913) - see also #527 - avoid gdal crash on 'ERROR 1: The buffer into which the data should be read is null'

This commit is contained in:
Dane Springmeyer 2010-03-17 22:00:00 +00:00
parent d6ef3014a3
commit 8477dcaf40

View file

@ -26,7 +26,7 @@
// boost
#include <boost/format.hpp>
#define MAPNIK_DEBUG
using mapnik::query;
using mapnik::coord2d;
using mapnik::Envelope;
@ -156,6 +156,8 @@ feature_ptr gdal_featureset::get_feature(mapnik::query const& q)
im_height = height;
}
if (im_width > 0 && im_height > 0)
{
mapnik::ImageData32 image(im_width, im_height);
image.set(0xffffffff);
@ -295,6 +297,7 @@ feature_ptr gdal_featureset::get_feature(mapnik::query const& q)
}
return feature;
}
}
return feature_ptr();
}