forked from BinomialLLC/basis_universal
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
30 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,15 @@ | ||
FROM --platform=linux/amd64 ubuntu:22.04 as builder | ||
|
||
RUN apt-get update | ||
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential cmake | ||
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential cmake clang | ||
|
||
COPY . /repo | ||
WORKDIR /repo/build | ||
RUN cmake .. -DCMAKE_INSTALL_PREFIX=/install | ||
RUN make -j8 | ||
RUN make install | ||
RUN clang++ /repo/mayhem/fuzz_floor_log2i.cpp -fsanitize=fuzzer,address -I /repo/transcoder/ -o /fuzz | ||
|
||
FROM ubuntu:22.04 as package | ||
COPY --from=builder /install /install | ||
COPY --from=builder /fuzz /fuzz_floor_log2i |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
project: basis-universal | ||
target: basisu | ||
target: floor-log2i | ||
|
||
cmds: | ||
- cmd: /install/bin/basisu @@ -validate | ||
env: | ||
DISABLE_SMOKETEST: '1' | ||
- cmd: /fuzz_floor_log2i | ||
libfuzzer: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
project: basis-universal | ||
target: basisu | ||
|
||
cmds: | ||
- cmd: /install/bin/basisu @@ -validate | ||
env: | ||
DISABLE_SMOKETEST: '1' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#include <stdint.h> | ||
#include <stdio.h> | ||
#include <climits> | ||
|
||
#include <fuzzer/FuzzedDataProvider.h> | ||
#include "basisu_containers.h" | ||
|
||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) | ||
{ | ||
FuzzedDataProvider provider(data, size); | ||
|
||
uint32_t v = provider.ConsumeIntegral<uint32_t>(); | ||
basisu::helpers::floor_log2i(v); | ||
return 0; | ||
} |