Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Xiph.Org
aom-rav1e
Commits
6bc11973
Commit
6bc11973
authored
Nov 24, 2017
by
Yaowu Xu
Browse files
Prevent out of bounds indices accessing arrays
Change-Id: Ic20b7314fc3a61738f2089d393f672d801037dda
parent
91058970
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
av1/encoder/rd.c
av1/encoder/rd.c
+8
-6
No files found.
av1/encoder/rd.c
View file @
6bc11973
...
...
@@ -173,18 +173,20 @@ void av1_fill_mode_rates(AV1_COMMON *const cm, MACROBLOCK *x,
int
sign_cost
[
CFL_JOINT_SIGNS
];
av1_cost_tokens_from_cdf
(
sign_cost
,
fc
->
cfl_sign_cdf
,
NULL
);
for
(
int
joint_sign
=
0
;
joint_sign
<
CFL_JOINT_SIGNS
;
joint_sign
++
)
{
const
aom_cdf_prob
*
cdf_u
=
fc
->
cfl_alpha_cdf
[
CFL_CONTEXT_U
(
joint_sign
)];
const
aom_cdf_prob
*
cdf_v
=
fc
->
cfl_alpha_cdf
[
CFL_CONTEXT_V
(
joint_sign
)];
int
*
cost_u
=
x
->
cfl_cost
[
joint_sign
][
CFL_PRED_U
];
int
*
cost_v
=
x
->
cfl_cost
[
joint_sign
][
CFL_PRED_V
];
if
(
CFL_SIGN_U
(
joint_sign
)
==
CFL_SIGN_ZERO
)
if
(
CFL_SIGN_U
(
joint_sign
)
==
CFL_SIGN_ZERO
)
{
memset
(
cost_u
,
0
,
CFL_ALPHABET_SIZE
*
sizeof
(
*
cost_u
));
else
}
else
{
const
aom_cdf_prob
*
cdf_u
=
fc
->
cfl_alpha_cdf
[
CFL_CONTEXT_U
(
joint_sign
)];
av1_cost_tokens_from_cdf
(
cost_u
,
cdf_u
,
NULL
);
if
(
CFL_SIGN_V
(
joint_sign
)
==
CFL_SIGN_ZERO
)
}
if
(
CFL_SIGN_V
(
joint_sign
)
==
CFL_SIGN_ZERO
)
{
memset
(
cost_v
,
0
,
CFL_ALPHABET_SIZE
*
sizeof
(
*
cost_v
));
else
}
else
{
const
aom_cdf_prob
*
cdf_v
=
fc
->
cfl_alpha_cdf
[
CFL_CONTEXT_V
(
joint_sign
)];
av1_cost_tokens_from_cdf
(
cost_v
,
cdf_v
,
NULL
);
}
for
(
int
u
=
0
;
u
<
CFL_ALPHABET_SIZE
;
u
++
)
cost_u
[
u
]
+=
sign_cost
[
joint_sign
];
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment