Buggy code:
public class SepPostingsReaderImpl extends PostingsReaderBase { final IntIndexInput freqIn ; final IntIndexInput docIn ; final IntIndexInput posIn ; final IndexInput payloadIn ; final IndexInput skipIn ; int skipInterval ; int maxSkipLevels ; int skipMinimum ; public SepPostingsReaderImpl ( Directory dir , SegmentInfo segmentInfo , int readBufferSize , IntStreamFactory intFactory , String codecId ) throws IOException { } public static void files ( SegmentInfo segmentInfo , String codecId , Collection < String > files ) { } @ Override public void init ( IndexInput termsIn ) throws IOException { } @ Override public void close ( ) throws IOException { } private static final class SepTermState extends BlockTermState { Index docIndex ; Index posIndex ; Index freqIndex ; long payloadFP ; long skipFP ; byte [ ] bytes ; ByteArrayDataInput bytesReader ; @ Override public Object clone ( ) { } @ Override public void copyFrom ( TermState _other ) { } @ Override public String toString ( ) { } } @ Override public BlockTermState newTermState ( ) throws IOException { } @ Override public void readTermsBlock ( IndexInput termsIn , FieldInfo fieldInfo , BlockTermState _termState ) throws IOException { } @ Override public void nextTerm ( FieldInfo fieldInfo , BlockTermState _termState ) throws IOException { final SepPostingsReaderImpl . SepTermState termState = ( ( SepPostingsReaderImpl . SepTermState ) ( _termState ) ) ; final boolean isFirstTerm = ( termState . termCount ) == 0 ; termState . docIndex . read ( termState . bytesReader , isFirstTerm ) ; if ( ! ( fieldInfo . omitTermFreqAndPositions ) ) { termState . freqIndex . read ( termState . bytesReader , isFirstTerm ) ; termState . posIndex . read ( termState . bytesReader , isFirstTerm ) ; if ( fieldInfo . storePayloads ) { if ( isFirstTerm ) { termState . payloadFP = termState . bytesReader . readVLong ( ) ; } else { termState . payloadFP += termState . bytesReader . readVLong ( ) ; } } } if ( ( termState . docFreq ) >= ( skipMinimum ) ) { if ( isFirstTerm ) { termState . skipFP = termState . bytesReader . readVLong ( ) ; } else { termState . skipFP += termState . bytesReader . readVLong ( ) ; } } else if ( isFirstTerm ) { <START_BUG> termState . skipFP = termState . bytesReader . readVLong ( ) ; <END_BUG> } } @ Override public DocsEnum docs ( FieldInfo fieldInfo , BlockTermState _termState , Bits skipDocs , DocsEnum reuse ) throws IOException { } @ Override public DocsAndPositionsEnum docsAndPositions ( FieldInfo fieldInfo , BlockTermState _termState , Bits skipDocs , DocsAndPositionsEnum reuse ) throws IOException { } class SepDocsEnum extends DocsEnum { int docFreq ; int doc ; int count ; int freq ; long freqStart ; private boolean omitTF ; private boolean storePayloads ; private Bits skipDocs ; private final Reader docReader ; private final Reader freqReader ; private long skipFP ; private final Index docIndex ; private final Index freqIndex ; private final Index posIndex ; private final IntIndexInput startDocIn ; boolean skipped ; SepSkipListReader skipper ; SepDocsEnum ( ) throws IOException { } SepPostingsReaderImpl . SepDocsEnum init ( FieldInfo fieldInfo , SepPostingsReaderImpl . SepTermState termState , Bits skipDocs ) throws IOException { } @ Override public int nextDoc ( ) throws IOException { } @ Override public int read ( ) throws IOException { } @ Override public int freq ( ) { } @ Override public int docID ( ) { } @ Override public int advance ( int target ) throws IOException { } } class SepDocsAndPositionsEnum extends DocsAndPositionsEnum { int docFreq ; int doc ; int count ; int freq ; long freqStart ; private boolean storePayloads ; private Bits skipDocs ; private final Reader docReader ; private final Reader freqReader ; private final Reader posReader ; private final IndexInput payloadIn ; private long skipFP ; private final Index docIndex ; private final Index freqIndex ; private final Index posIndex ; private final IntIndexInput startDocIn ; private long payloadFP ; private int pendingPosCount ; private int position ; private int payloadLength ; private long pendingPayloadBytes ; private boolean skipped ; private SepSkipListReader skipper ; private boolean payloadPending ; private boolean posSeekPending ; SepDocsAndPositionsEnum ( ) throws IOException { } SepPostingsReaderImpl . SepDocsAndPositionsEnum init ( FieldInfo fieldInfo , SepPostingsReaderImpl . SepTermState termState , Bits skipDocs ) throws IOException { } @ Override public int nextDoc ( ) throws IOException { } @ Override public int freq ( ) { } @ Override public int docID ( ) { } @ Override public int advance ( int target ) throws IOException { } @ Override public int nextPosition ( ) throws IOException { } private BytesRef payload ; @ Override public BytesRef getPayload ( ) throws IOException { } @ Override public boolean hasPayload ( ) { } } }

Fix:
termState . skipFP = 0 ;