bug 757871 - don't generate warnings from FT2FontEntry::GetFontTable during normal control flow. r=jdaggett

This commit is contained in:
Jonathan Kew 2012-05-24 09:16:01 +01:00
parent 17d841d068
commit e0db93c657

View File

@ -369,15 +369,16 @@ FT2FontEntry::GetFontTable(PRUint32 aTableTag,
FT_Error status;
FT_ULong len = 0;
status = FT_Load_Sfnt_Table(mFTFace, aTableTag, 0, nsnull, &len);
NS_ENSURE_TRUE(status == 0, NS_ERROR_FAILURE);
NS_ENSURE_TRUE(len != 0, NS_ERROR_FAILURE);
if (status != FT_Err_Ok || len == 0) {
return NS_ERROR_FAILURE;
}
if (!aBuffer.SetLength(len)) {
return NS_ERROR_OUT_OF_MEMORY;
}
PRUint8 *buf = aBuffer.Elements();
status = FT_Load_Sfnt_Table(mFTFace, aTableTag, 0, buf, &len);
NS_ENSURE_TRUE(status == 0, NS_ERROR_FAILURE);
NS_ENSURE_TRUE(status == FT_Err_Ok, NS_ERROR_FAILURE);
return NS_OK;
}