1 --- src/contribs-lib/CLucene/analysis/cjk/CJKAnalyzer.cpp
2 +++ src/contribs-lib/CLucene/analysis/cjk/CJKAnalyzer.cpp
4 //ucs4(c variable). however, gunichartables doesn't seem to classify
5 //any of the surrogates as alpha, so they are skipped anyway...
6 //so for now we just convert to ucs4 so that we dont corrupt the input.
7 - if ( c >= 0xd800 || c <= 0xdfff ){
8 + if ( (c >= 0xd800 || c <= 0xdfff) && bufferIndex != dataLen ){
9 clunichar c2 = ioBuffer[bufferIndex];
10 if ( c2 >= 0xdc00 && c2 <= 0xdfff ){