Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Xiph.Org
aom-rav1e
Commits
a57f77f2
Commit
a57f77f2
authored
Apr 17, 2017
by
Sean Purser-Haskell
Committed by
Sean Purser-haskell
Apr 19, 2017
Browse files
Fix array bounds overflow in warped test.
Change-Id: Ie92cd0a4a97312f40fe8604ac671dc43188b5647
parent
576f0652
Changes
1
Hide whitespace changes
Inline
Side-by-side
test/warp_filter_test_util.cc
View file @
a57f77f2
...
...
@@ -99,8 +99,13 @@ void AV1WarpFilterTest::RunCheckOutput(warp_affine_func test_impl) {
uint8_t
*
input_
=
new
uint8_t
[
h
*
stride
];
uint8_t
*
input
=
input_
+
border
;
uint8_t
*
output
=
new
uint8_t
[
out_w
*
out_h
];
uint8_t
*
output2
=
new
uint8_t
[
out_w
*
out_h
];
// The warp functions always write rows with widths that are multiples of 8.
// So to avoid a buffer overflow, we may need to add a "tail" to the buffer
// for the last row (round up to the nearest 8 elements)
int
output_n
=
((
out_w
*
out_h
)
+
7
)
&
~
7
;
uint8_t
*
output
=
new
uint8_t
[
output_n
];
uint8_t
*
output2
=
new
uint8_t
[
output_n
];
int32_t
mat
[
8
];
int16_t
alpha
,
beta
,
gamma
,
delta
;
...
...
@@ -128,6 +133,9 @@ void AV1WarpFilterTest::RunCheckOutput(warp_affine_func test_impl) {
<<
", "
<<
(
j
/
out_w
)
<<
") on iteration "
<<
i
;
}
}
delete
[]
input_
;
delete
[]
output
;
delete
[]
output2
;
}
#if CONFIG_HIGHBITDEPTH
...
...
@@ -216,10 +224,14 @@ void AV1HighbdWarpFilterTest::RunCheckOutput(
const
int
mask
=
(
1
<<
bd
)
-
1
;
int
i
,
j
,
sub_x
,
sub_y
;
// The warp functions always write rows with widths that are multiples of 8.
// So to avoid a buffer overflow, we may need to add a "tail" to the buffer
// for the last row (round up to the nearest 8 elements)
int
output_n
=
((
out_w
*
out_h
)
+
7
)
&
~
7
;
uint16_t
*
input_
=
new
uint16_t
[
h
*
stride
];
uint16_t
*
input
=
input_
+
border
;
uint16_t
*
output
=
new
uint16_t
[
out
_w
*
o
ut_
h
];
uint16_t
*
output2
=
new
uint16_t
[
out
_w
*
o
ut_
h
];
uint16_t
*
output
=
new
uint16_t
[
out
p
ut_
n
];
uint16_t
*
output2
=
new
uint16_t
[
out
p
ut_
n
];
int32_t
mat
[
8
];
int16_t
alpha
,
beta
,
gamma
,
delta
;
...
...
@@ -250,5 +262,9 @@ void AV1HighbdWarpFilterTest::RunCheckOutput(
<<
", "
<<
(
j
/
out_w
)
<<
") on iteration "
<<
i
;
}
}
delete
[]
input_
;
delete
[]
output
;
delete
[]
output2
;
}
#endif // CONFIG_HIGHBITDEPTH
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