diff --git a/src/share/native/sun/font/freetypeScaler.c b/src/share/native/sun/font/freetypeScaler.c index e4b37fd9a93bffabfa71eb66e54eac4b260b1bc6..55ca4ebc82c7e0aa5f7fca287e63d113f9d4f1ea 100644 --- a/src/share/native/sun/font/freetypeScaler.c +++ b/src/share/native/sun/font/freetypeScaler.c @@ -177,18 +177,10 @@ static unsigned long ReadTTFontFileFunc(FT_Stream stream, if (numBytes > FILEDATACACHESIZE) { bBuffer = (*env)->NewDirectByteBuffer(env, destBuffer, numBytes); if (bBuffer != NULL) { - /* Loop until the read succeeds (or EOF). - * This should improve robustness in the event of a problem in - * the I/O system. If we find that we ever end up spinning here - * we are going to have to do some serious work to recover. - * Just returning without reading the data will cause a crash. - */ - while (bread == 0) { - bread = (*env)->CallIntMethod(env, - scalerInfo->font2D, - sunFontIDs.ttReadBlockMID, - bBuffer, offset, numBytes); - } + bread = (*env)->CallIntMethod(env, + scalerInfo->font2D, + sunFontIDs.ttReadBlockMID, + bBuffer, offset, numBytes); return bread; } else { /* We probably hit bug bug 4845371. For reasons that @@ -224,19 +216,10 @@ static unsigned long ReadTTFontFileFunc(FT_Stream stream, (offset + FILEDATACACHESIZE > scalerInfo->fileSize) ? scalerInfo->fileSize - offset : FILEDATACACHESIZE; bBuffer = scalerInfo->directBuffer; - /* Loop until all the read succeeds (or EOF). - * This should improve robustness in the event of a problem in - * the I/O system. If we find that we ever end up spinning here - * we are going to have to do some serious work to recover. - * Just returning without reading the data will cause a crash. - */ - while (bread == 0) { - bread = (*env)->CallIntMethod(env, scalerInfo->font2D, - sunFontIDs.ttReadBlockMID, - bBuffer, offset, - scalerInfo->fontDataLength); - } - + bread = (*env)->CallIntMethod(env, scalerInfo->font2D, + sunFontIDs.ttReadBlockMID, + bBuffer, offset, + scalerInfo->fontDataLength); memcpy(destBuffer, scalerInfo->fontData, numBytes); return numBytes; }