Skip to content

Commit ad3c0b6

Browse files
author
rouault
committedMar 27, 2015
ogr2ogr: fix infinite loop if using -fid with -gt 1
git-svn-id: https://svn.osgeo.org/gdal/trunk/gdal@28803 f0d54148-0727-0410-94bb-9a71ac55c965
1 parent 7ad12fd commit ad3c0b6

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed
 

‎apps/ogr2ogr.cpp

+4-7
Original file line numberDiff line numberDiff line change
@@ -3664,13 +3664,7 @@ int LayerTranslator::Translate( TargetLayerInfo* psInfo,
36643664
OGRFeature *poDstFeature = NULL;
36653665

36663666
if( nFIDToFetch != OGRNullFID )
3667-
{
3668-
// Only fetch feature on first pass.
3669-
if( nFeaturesInTransaction == 0 )
3670-
poFeature = poSrcLayer->GetFeature(nFIDToFetch);
3671-
else
3672-
poFeature = NULL;
3673-
}
3667+
poFeature = poSrcLayer->GetFeature(nFIDToFetch);
36743668
else
36753669
poFeature = poSrcLayer->GetNextFeature();
36763670

@@ -3987,6 +3981,9 @@ int LayerTranslator::Translate( TargetLayerInfo* psInfo,
39873981

39883982
if (pnReadFeatureCount)
39893983
*pnReadFeatureCount = nCount;
3984+
3985+
if( nFIDToFetch != OGRNullFID )
3986+
break;
39903987
}
39913988

39923989
if( nGroupTransactions )

0 commit comments

Comments
 (0)
Please sign in to comment.