KmlRenderer - FATAL EXCEPTION: width and height must be > 0 #863
Labels
priority: p3
Desirable enhancement or fix. May not be included in next release.
type: bug
Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Please be sure to include as much information as possible:
Summary
When trying to create a KmlLayer, a "FATAL EXCEPTION" occurs when trying to "createBitmap", the error is "width and height must be > 0"
Expected behavior
Prevent the "FATAL EXCEPTION" and get a warning or throw an exception
Observed behavior
When trying to create a KmlLayer with an Kml file that has images, for some Kml files it throws the fatal exception indicating that the width and height must be > 0 instead of throwing an exception, the KmlRenderer.scaleBitmap is not validating the width and height before calling the Bitmap.createBitmap libray.
Environment details
com.google.maps.android:android-maps-utils:2.2.2
com.google.maps.android.data.kml.KmlLayer
KmlRenderer
Steps to reproduce
If you can reproduce using the demo app in the project, it helps us troubleshoot faster.
KmlLayer kmlLayer = new KmlLayer(mMap, new ByteArrayInputStream(kmz.getBytes()), this);
kmlLayer.addLayerToMap();
Code example
Stack trace
Thanks!
The text was updated successfully, but these errors were encountered: