Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
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
775a4bed
Commit
775a4bed
authored
Apr 20, 2017
by
Sean Purser-Haskell
Committed by
Sean Purser-haskell
Apr 20, 2017
Browse files
Correct row padding to avoid overflow in all cases.
Change-Id: I88041e954fa6cff5986458309bb28fa2e3c9758c
parent
9aeaeb7d
Changes
1
Hide whitespace changes
Inline
Side-by-side
test/warp_filter_test_util.cc
View file @
775a4bed
...
...
@@ -101,9 +101,8 @@ void AV1WarpFilterTest::RunCheckOutput(warp_affine_func test_impl) {
uint8_t
*
input
=
input_
+
border
;
// 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
;
// So to avoid a buffer overflow, we may need to pad rows to a multiple of 8.
int
output_n
=
((
out_w
+
7
)
&
~
7
)
*
out_h
;
uint8_t
*
output
=
new
uint8_t
[
output_n
];
uint8_t
*
output2
=
new
uint8_t
[
output_n
];
int32_t
mat
[
8
];
...
...
@@ -225,9 +224,8 @@ void AV1HighbdWarpFilterTest::RunCheckOutput(
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
;
// So to avoid a buffer overflow, we may need to pad rows to a multiple of 8.
int
output_n
=
((
out_w
+
7
)
&
~
7
)
*
out_h
;
uint16_t
*
input_
=
new
uint16_t
[
h
*
stride
];
uint16_t
*
input
=
input_
+
border
;
uint16_t
*
output
=
new
uint16_t
[
output_n
];
...
...
Write
Preview
Supports
Markdown
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