Index: src/java/org/apache/lucene/util/SortedVIntList.java
===================================================================
--- src/java/org/apache/lucene/util/SortedVIntList.java	(revision 900034)
+++ src/java/org/apache/lucene/util/SortedVIntList.java	(working copy)
@@ -128,8 +128,8 @@
       }
   
       if ((lastBytePos + MAX_BYTES_PER_INT) > bytes.length) {
-        // biggest possible int does not fit
-        resizeBytes((bytes.length * 2) + MAX_BYTES_PER_INT);
+        // Biggest possible int does not fit.
+        resizeBytes(ArrayUtil.getNextSize(bytes.length + MAX_BYTES_PER_INT));
       }
   
       // See org.apache.lucene.store.IndexOutput.writeVInt()
Index: src/test/org/apache/lucene/util/TestSortedVIntList.java
===================================================================
--- src/test/org/apache/lucene/util/TestSortedVIntList.java	(revision 900034)
+++ src/test/org/apache/lucene/util/TestSortedVIntList.java	(working copy)
@@ -193,4 +193,15 @@
   public void test12() {
    tstIllegalArgExc(new int[] {0,1,1,2,3,5,8,0});
   }
+  public void test13Allocation() {
+    int [] a = new int[2000]; // SortedVIntList initial byte size is 128
+    for (int i = 0; i < a.length; i++) {
+      a[i] = (107 + i) * i;
+    }
+    try {
+      tstIterator(new SortedVIntList(a), a);
+    } catch (IOException ioe) {
+      throw new Error(ioe);
+    }
+  }
 }
