Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
libaec
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Mathis Rosenhauer
libaec
Commits
6f2d841a
Commit
6f2d841a
authored
Sep 04, 2018
by
Mathis Rosenhauer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use fuzzer data on both encoder and decoder (fixes #7)
parent
031a9990
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
fuzz_target.cc
fuzzing/fuzz_target.cc
+12
-4
No files found.
fuzzing/fuzz_target.cc
View file @
6f2d841a
...
...
@@ -12,6 +12,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
strm
.
bits_per_sample
=
(
Data
[
0
]
&
0x1f
)
|
1
;
strm
.
block_size
=
8
<<
(
Data
[
1
]
&
3
);
strm
.
rsi
=
2
;
strm
.
flags
=
AEC_DATA_PREPROCESS
;
if
(
Data
[
1
]
&
0x80
)
strm
.
flags
|=
AEC_DATA_MSB
;
...
...
@@ -21,14 +22,21 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
strm
.
bits_per_sample
>
16
&&
Data
[
1
]
&
0x10
)
strm
.
flags
|=
AEC_DATA_3BYTE
;
// Decode data
strm
.
next_in
=
(
unsigned
char
*
)(
Data
+
2
);
strm
.
avail_in
=
Size
-
2
;
strm
.
next_out
=
dest
;
strm
.
avail_out
=
(
Size
-
2
)
*
4
;
if
(
Data
[
1
]
&
0x20
)
aec_buffer_encode
(
&
strm
);
else
// Encode data
strm
.
next_in
=
(
unsigned
char
*
)(
Data
+
2
);
strm
.
avail_in
=
Size
-
2
;
strm
.
next_out
=
dest
;
strm
.
avail_out
=
(
Size
-
2
)
*
4
;
aec_buffer_decode
(
&
strm
);
free
(
dest
);
return
0
;
}
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