Skip to content

Commit

Permalink
FAAD2 を 2.11.1 に更新
Browse files Browse the repository at this point in the history
  • Loading branch information
DBCTRADO committed Nov 19, 2023
1 parent 61af781 commit d4263d6
Show file tree
Hide file tree
Showing 214 changed files with 3,057 additions and 16,977 deletions.
18 changes: 18 additions & 0 deletions Thirdparty/faad2/.bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Force the use of Clang for C++ builds.
build --action_env=CC=clang
build --action_env=CXX=clang++

# Define the --config=asan-libfuzzer configuration.
build:asan-libfuzzer --@rules_fuzzing//fuzzing:cc_engine=@rules_fuzzing//fuzzing/engines:libfuzzer
build:asan-libfuzzer --@rules_fuzzing//fuzzing:cc_engine_instrumentation=libfuzzer
build:asan-libfuzzer --@rules_fuzzing//fuzzing:cc_engine_sanitizer=asan

# Define the --config=msan-libfuzzer configuration.
build:msan-libfuzzer --@rules_fuzzing//fuzzing:cc_engine=@rules_fuzzing//fuzzing/engines:libfuzzer
build:msan-libfuzzer --@rules_fuzzing//fuzzing:cc_engine_instrumentation=libfuzzer
build:msan-libfuzzer --@rules_fuzzing//fuzzing:cc_engine_sanitizer=msan

# Define the --config=ubsan-libfuzzer configuration.
build:ubsan-libfuzzer --@rules_fuzzing//fuzzing:cc_engine=@rules_fuzzing//fuzzing/engines:libfuzzer
build:ubsan-libfuzzer --@rules_fuzzing//fuzzing:cc_engine_instrumentation=libfuzzer
build:ubsan-libfuzzer --@rules_fuzzing//fuzzing:cc_engine_sanitizer=ubsan
22 changes: 1 addition & 21 deletions Thirdparty/faad2/.gitignore
Original file line number Diff line number Diff line change
@@ -1,21 +1 @@
*.o
*.so
*.a
*.ncb
*.plg
*.aps
*.opt
*.aac
*.wav
*.lo
*.in
Makefile
*.libs
*.deps
*.la
project/msvc/.vs/
project/msvc/bin/
project/msvc/intermediate/
#libfaad/win32_ver.h
*.user
/libfaad/faad2.pc
bazel-*
80 changes: 80 additions & 0 deletions Thirdparty/faad2/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
load("@rules_fuzzing//fuzzing:cc_defs.bzl", "cc_fuzz_test")
load("@properties//:properties.bzl", "PROPERTIES")

# Unless building for embedded systems all headers / functions should exist.
FAAD_DEFINES = [
"APPLY_DRC",
"HAVE_INTTYPES_H=1",
"HAVE_MEMCPY=1",
"HAVE_STRING_H=1",
"HAVE_STRINGS_H=1",
"HAVE_SYS_STAT_H=1",
"HAVE_SYS_TYPES_H=1",
"STDC_HEADERS=1",
"PACKAGE_VERSION=\\\"%s\\\"" % PROPERTIES["PACKAGE_VERSION"],
]

FAAD_SOURCES = glob([
"libfaad/**/*.c",
"libfaad/**/*.h",
])

FAAD_FLAGS = [
"-Wall",
"-pedantic",
]

DRM_AFFIX = [
"",
"_drm",
]

DRM_DEFINES = [
[],
["DRM_SUPPORT"],
]

FIXED_AFFIX = [
"",
"_fixed",
]

FIXED_DEFINES = [
[],
["FIXED_POINT"],
]

[cc_library(
name = "faad" + DRM_AFFIX[drm] + FIXED_AFFIX[fixed],
srcs = FAAD_SOURCES,
hdrs = ["include/neaacdec.h"],
copts = FAAD_FLAGS,
includes = ["libfaad"],
local_defines = FAAD_DEFINES + DRM_DEFINES[drm] + FIXED_DEFINES[fixed],
strip_include_prefix = "include",
) for drm in range(2) for fixed in range(2)]

# To start fuzzing run: bazel run --config=asan-libfuzzer //:fuzz_config_run
cc_fuzz_test(
name = "fuzz_config",
srcs = ["fuzz/fuzz_config.c"],
deps = [":faad"],
)

# To start fuzzing run: bazel run --config=asan-libfuzzer //:fuzz_decode_run
[cc_fuzz_test(
name = "fuzz_decode" + DRM_AFFIX[drm] + FIXED_AFFIX[fixed],
srcs = ["fuzz/fuzz_decode.c"],
local_defines = DRM_DEFINES[drm],
deps = [":faad" + DRM_AFFIX[drm] + FIXED_AFFIX[fixed]],
) for drm in range(2) for fixed in range(2)]

CLI_SOURCES = glob(["frontend/**/*.c", "frontend/**/*.h"], exclude = ["frontend/**/getopt.*"])

[cc_binary(
name = "faad_cli" + DRM_AFFIX[drm] + FIXED_AFFIX[fixed],
srcs = CLI_SOURCES,
includes = ["frontend"],
local_defines = FAAD_DEFINES + DRM_DEFINES[drm] + FIXED_DEFINES[fixed],
deps = [":faad" + DRM_AFFIX[drm] + FIXED_AFFIX[fixed]],
) for drm in range(2) for fixed in range(2)]
Loading

0 comments on commit d4263d6

Please sign in to comment.