From 1bfd01b25a762875e9d02bbac9eb65f06d733ebb Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Tue, 17 Jun 2014 21:56:15 +0200 Subject: [PATCH] Fix crash in QgsVectorFileWriter::addFeature() createFeature() might return a NULL pointer that OGR_L_CreateFeature() will crash upon when GDAL is compiled in debug mode (where null pointer assertions are turned on) --- src/core/qgsvectorfilewriter.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/core/qgsvectorfilewriter.cpp b/src/core/qgsvectorfilewriter.cpp index 4c1872450f2..5ba19bbbb15 100644 --- a/src/core/qgsvectorfilewriter.cpp +++ b/src/core/qgsvectorfilewriter.cpp @@ -1548,6 +1548,8 @@ bool QgsVectorFileWriter::addFeature( QgsFeature& feature, QgsFeatureRendererV2* { // create the feature OGRFeatureH poFeature = createFeature( feature ); + if( !poFeature ) + return false; //add OGR feature style type if ( mSymbologyExport != NoSymbology && renderer )