未验证 提交 6ec6e8bf 编写于 作者: O openharmony_ci 提交者: Gitee

!803 修复警告#7

Merge pull request !803 from youbing54/cherry-pick-1666877065
......@@ -319,7 +319,11 @@ bool UIFontVector::GetTtfInfoFromTtf(uint8_t ttfId,
if (fpTtf < 0) {
return false;
}
ttfHeader.len = lseek(fpTtf, 0, SEEK_END);
int32_t headerLength = lseek(fpTtf, 0, SEEK_END);
if (headerLength < 0) {
return false;
}
ttfHeader.len = static_cast<uint32_t>(headerLength);
if (ttfHeader.len > ttfBufferSize) {
close(fpTtf);
return false;
......@@ -330,7 +334,7 @@ bool UIFontVector::GetTtfInfoFromTtf(uint8_t ttfId,
return false;
}
ret = read(fpTtf, reinterpret_cast<void*>(ttfBuffer), ttfHeader.len);
if (ret != ttfHeader.len) {
if (ret != headerLength) {
close(fpTtf);
return false;
}
......@@ -396,7 +400,10 @@ bool UIFontVector::GetTtfInfoFromTtc(uint8_t ttfId,
return false;
}
uint32_t ttfLength = 0;
FT_Long ttcLength = stream->size;
FT_ULong ttcLength = stream->size;
if (ttcLength < ttfOffset) {
return false;
}
if (ttfIndex + 1 == header.numFonts) {
ttfLength = ttcLength - ttfOffset;
} else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册