Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
btwise
OpenCorePKG_MOD
提交
079070a2
O
OpenCorePKG_MOD
项目概览
btwise
/
OpenCorePKG_MOD
通知
26
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
OpenCorePKG_MOD
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
079070a2
编写于
4月 07, 2020
作者:
D
Download-Fritz
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix several issues (Coverity, Clang)
上级
06448c85
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
80 addition
and
42 deletion
+80
-42
Include/Library/OcAppleKernelLib.h
Include/Library/OcAppleKernelLib.h
+1
-1
Library/OcAppleKernelLib/KernelReader.c
Library/OcAppleKernelLib/KernelReader.c
+1
-1
Library/OcBootManagementLib/AppleHibernate.c
Library/OcBootManagementLib/AppleHibernate.c
+2
-1
Library/OcConsoleLib/TextOutputBuiltin.c
Library/OcConsoleLib/TextOutputBuiltin.c
+1
-1
Library/OcFileLib/FsConnectQuirk.c
Library/OcFileLib/FsConnectQuirk.c
+6
-0
Library/OcHiiDatabaseLib/ConfigRouting.c
Library/OcHiiDatabaseLib/ConfigRouting.c
+1
-0
Library/OcHiiDatabaseLib/HiiDatabase.h
Library/OcHiiDatabaseLib/HiiDatabase.h
+4
-4
Platform/OpenCanopy/BitmapFont.c
Platform/OpenCanopy/BitmapFont.c
+64
-34
未找到文件。
Include/Library/OcAppleKernelLib.h
浏览文件 @
079070a2
...
...
@@ -209,7 +209,7 @@ typedef struct {
RETURN_STATUS
ReadAppleKernel
(
IN
EFI_FILE_PROTOCOL
*
File
,
IN
OUT
UINT8
**
Kernel
,
OUT
UINT8
**
Kernel
,
OUT
UINT32
*
KernelSize
,
OUT
UINT32
*
AllocatedSize
,
IN
UINT32
ReservedSize
...
...
Library/OcAppleKernelLib/KernelReader.c
浏览文件 @
079070a2
...
...
@@ -318,7 +318,7 @@ ReadAppleKernelImage (
RETURN_STATUS
ReadAppleKernel
(
IN
EFI_FILE_PROTOCOL
*
File
,
IN
OUT
UINT8
**
Kernel
,
OUT
UINT8
**
Kernel
,
OUT
UINT32
*
KernelSize
,
OUT
UINT32
*
AllocatedSize
,
IN
UINT32
ReservedSize
...
...
Library/OcBootManagementLib/AppleHibernate.c
浏览文件 @
079070a2
...
...
@@ -115,11 +115,12 @@ OcActivateHibernateWake (
DEBUG
((
DEBUG_INFO
,
"OCB: boot-image is %u bytes - %r
\n
"
,
(
UINT32
)
Size
,
Status
));
RtcRawVars
=
(
UINT8
*
)
&
RtcVars
;
//
// Work with RTC memory if allowed.
//
if
(
HibernateMask
&
HIBERNATE_MODE_RTC
)
{
RtcRawVars
=
(
UINT8
*
)
&
RtcVars
;
for
(
Index
=
0
;
Index
<
sizeof
(
AppleRTCHibernateVars
);
Index
++
)
{
RtcRawVars
[
Index
]
=
OcRtcRead
(
Index
+
128
);
}
...
...
Library/OcConsoleLib/TextOutputBuiltin.c
浏览文件 @
079070a2
...
...
@@ -207,7 +207,7 @@ RenderChar (
SetMem32
(
DstBuffer
,
TGT_CHAR_AREA
*
sizeof
(
DstBuffer
[
0
]),
mBackgroundColor
.
Raw
);
}
else
{
if
(
Char
<
ISO_CHAR_MIN
||
Char
>
ISO_CHAR_MAX
)
{
if
(
Char
<
0
||
Char
>
ISO_CHAR_MAX
)
{
Char
=
L'_'
;
}
...
...
Library/OcFileLib/FsConnectQuirk.c
浏览文件 @
079070a2
...
...
@@ -103,6 +103,12 @@ OcUnblockUnmountedPartitions (
DiskIoInfos
[
DiskIoInfoIndex
].
AgentHandle
,
NULL
);
DEBUG
((
DEBUG_INFO
,
"OCFSQ: Failed to unblock handle %p - %r
\n
"
,
Handles
[
HandleIndex
],
Status
));
}
}
...
...
Library/OcHiiDatabaseLib/ConfigRouting.c
浏览文件 @
079070a2
...
...
@@ -1117,6 +1117,7 @@ MergeDefaultString (
(
VOID
*
)
(
*
AltCfgResp
)
);
if
(
*
AltCfgResp
==
NULL
)
{
*
StringPtrEnd
=
TempChar
;
FreePool
(
AltConfigHdr
);
return
EFI_OUT_OF_RESOURCES
;
}
...
...
Library/OcHiiDatabaseLib/HiiDatabase.h
浏览文件 @
079070a2
...
...
@@ -50,10 +50,10 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#define PROPORTIONAL_GLYPH 0x80
#define NARROW_GLYPH 0x40
#define BITMAP_LEN_1_BIT(Width, Height) (((
Width) + 7) / 8 *
(Height))
#define BITMAP_LEN_4_BIT(Width, Height) (((
Width) + 1) / 2 *
(Height))
#define BITMAP_LEN_8_BIT(Width, Height) ((
Width) *
(Height))
#define BITMAP_LEN_24_BIT(Width, Height) ((
Width) *
(Height) * 3)
#define BITMAP_LEN_1_BIT(Width, Height) (((
UINT32) (Width) + 7) / 8 * (UINT32)
(Height))
#define BITMAP_LEN_4_BIT(Width, Height) (((
UINT32) (Width) + 1) / 2 * (UINT32)
(Height))
#define BITMAP_LEN_8_BIT(Width, Height) ((
UINT32) (Width) * (UINT32)
(Height))
#define BITMAP_LEN_24_BIT(Width, Height) ((
UINT32) (Width) * (UINT32)
(Height) * 3)
extern
EFI_LOCK
mHiiDatabaseLock
;
...
...
Platform/OpenCanopy/BitmapFont.c
浏览文件 @
079070a2
...
...
@@ -151,7 +151,9 @@ BmfContextInitialize (
INT16
MinY
;
UINT16
MaxY
;
INT32
Height
;
INT32
Width
;
INT32
Advance
;
CONST
BMF_CHAR
*
Chars
;
CONST
BMF_KERNING_PAIR
*
Pairs
;
...
...
@@ -314,8 +316,26 @@ BmfContextInitialize (
MaxY
=
0
;
for
(
Index
=
0
;
Index
<
Context
->
NumChars
;
++
Index
)
{
if
((
INT32
)
Chars
[
Index
].
yoffset
+
(
INT32
)
Chars
[
Index
].
height
<=
0
||
Chars
[
Index
].
width
<
0
||
Chars
[
Index
].
xadvance
<
0
)
{
Result
=
OcOverflowAddS32
(
Chars
[
Index
].
yoffset
,
Chars
[
Index
].
height
,
&
Height
);
Result
|=
OcOverflowAddS32
(
Chars
[
Index
].
xoffset
,
Chars
[
Index
].
width
,
&
Width
);
Result
|=
OcOverflowAddS32
(
Chars
[
Index
].
xoffset
,
Chars
[
Index
].
xadvance
,
&
Advance
);
if
(
Result
||
0
>
Height
||
Height
>
MAX_UINT16
||
0
>
Width
||
Width
>
MAX_UINT16
||
0
>
Advance
||
Advance
>
MAX_UINT16
||
Chars
[
Index
].
xadvance
<
0
)
{
DEBUG
((
DEBUG_WARN
,
"BMF: Char insane
\n
"
...
...
@@ -343,26 +363,8 @@ BmfContextInitialize (
return
FALSE
;
}
Result
=
OcOverflowAddS32
(
Chars
[
Index
].
xoffset
,
Chars
[
Index
].
width
,
&
Width
);
if
(
Result
||
Width
<
0
)
{
return
FALSE
;
}
Result
=
OcOverflowAddS32
(
Chars
[
Index
].
xoffset
,
Chars
[
Index
].
xadvance
,
&
Width
);
if
(
Result
||
Width
<
0
)
{
return
FALSE
;
}
MinY
=
MIN
(
MinY
,
Chars
[
Index
].
yoffset
);
MaxY
=
MAX
(
MaxY
,
Chars
[
Index
].
yoffset
+
Chars
[
Index
].
h
eight
);
MaxY
=
MAX
(
MaxY
,
(
UINT16
)
H
eight
);
//
// This only yields unexpected but not undefined behaviour when not met,
// hence it is fine verifying it only DEBUG mode.
...
...
@@ -380,14 +382,34 @@ BmfContextInitialize (
DEBUG_CODE_END
();
}
Context
->
Height
=
MaxY
-
MinY
;
Result
=
OcOverflowSubS32
(
MaxY
,
MinY
,
&
Height
);
if
(
Result
||
0
>=
Height
||
Height
>
MAX_UINT16
)
{
DEBUG
((
DEBUG_WARN
,
"BMF: Insane font Y info %d %d
\n
"
,
MaxY
,
MinY
));
return
FALSE
;
}
Context
->
Height
=
(
UINT16
)
Height
;
Context
->
OffsetY
=
-
MinY
;
Pairs
=
Context
->
KerningPairs
;
for
(
Index
=
0
;
Index
<
Context
->
NumKerningPairs
;
++
Index
)
{
Char
=
BmfGetChar
(
Context
,
Pairs
[
Index
].
first
);
if
(
Char
==
NULL
)
{
DEBUG
((
DEBUG_WARN
,
"BMF: Pair char not found
\n
"
));
DEBUG
((
DEBUG_WARN
,
"BMF: Pair char %u not found
\n
"
,
Pairs
[
Index
].
first
));
return
FALSE
;
}
...
...
@@ -396,16 +418,24 @@ BmfContextInitialize (
Pairs
[
Index
].
amount
,
&
Width
);
if
(
Result
||
Width
<
0
)
{
return
FALSE
;
}
Result
=
OcOverflowAddS32
(
Char
->
xoffset
+
Char
->
xadvance
,
Pairs
[
Index
].
amount
,
&
Width
);
if
(
Result
||
Width
<
0
)
{
Result
|=
OcOverflowAddS32
(
Char
->
xoffset
+
Char
->
xadvance
,
Pairs
[
Index
].
amount
,
&
Advance
);
if
(
Result
||
0
>
Width
||
Width
>
MAX_UINT16
||
0
>
Advance
||
Advance
>
MAX_UINT16
)
{
DEBUG
((
DEBUG_WARN
,
"BMF: Pair insane
\n
"
" first %u
\n
"
" second %u
\n
"
" amount %d
\n
"
,
Pairs
[
Index
].
first
,
Pairs
[
Index
].
second
,
Pairs
[
Index
].
amount
));
return
FALSE
;
}
//
...
...
@@ -607,7 +637,7 @@ GuiGetLabel (
return
FALSE
;
}
Buffer
=
AllocateZeroPool
(
TextInfo
->
Width
*
TextInfo
->
Height
*
sizeof
(
*
Buffer
));
Buffer
=
AllocateZeroPool
(
(
UINT32
)
TextInfo
->
Width
*
(
UINT32
)
TextInfo
->
Height
*
sizeof
(
*
Buffer
));
if
(
Buffer
==
NULL
)
{
DEBUG
((
DEBUG_WARN
,
"BMF: out of res
\n
"
));
FreePool
(
TextInfo
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录