From fe503892ba32473b0cf088168e5b44575624193c Mon Sep 17 00:00:00 2001 From: WeebDataHoarder <57538841+WeebDataHoarder@users.noreply.github.com> Date: Fri, 22 Apr 2022 18:18:09 +0200 Subject: [PATCH] Disable ALAC by default due to security issues. --- .drone.yml | 4 ++-- README.md | 6 ++++++ audio/format/alac/{alac.go => libalac.go} | 4 ++-- audio/format/alac/{alac_test.go => libalac_test.go} | 4 ++-- audio/format/guess/init_alac.go | 4 ++-- 5 files changed, 14 insertions(+), 8 deletions(-) rename audio/format/alac/{alac.go => libalac.go} (97%) rename audio/format/alac/{alac_test.go => libalac_test.go} (87%) diff --git a/.drone.yml b/.drone.yml index cd8553d..72db13c 100644 --- a/.drone.yml +++ b/.drone.yml @@ -18,7 +18,7 @@ steps: - git clone --depth 1 https://gitlab.xiph.org/xiph/libopusenc.git && cd libopusenc && ./autogen.sh && ./configure --prefix /usr && make && make install && cd .. - git clone --depth 1 https://git.gammaspectra.live/S.O.N.G/alac.git && cd alac && autoreconf -fi && ./configure --prefix /usr && make && make install && cd .. - go test -cover -v ./... - - go test -cover -v -tags=disable_codec_libfdk-aac,disable_codec_lame,disable_codec_tta ./... + - go test -cover -v -tags=disable_codec_libfdk-aac,disable_codec_lame,disable_codec_tta,enable_codec_libalac ./... - go test -cover -v -tags=disable_format_aac,disable_format_alac,disable_format_mp3,disable_format_opus,disable_format_tta,disable_format_vorbis ./... --- kind: pipeline @@ -40,6 +40,6 @@ steps: - git clone --depth 1 https://github.com/mstorsjo/fdk-aac.git && cd fdk-aac && ./autogen.sh && ./configure --prefix /usr && make -j$(nproc) && make install && cd .. - git clone --depth 1 https://git.gammaspectra.live/S.O.N.G/alac.git && cd alac && autoreconf -fi && ./configure --prefix /usr && make && make install && cd .. - go test -cover -v ./... - - go test -cover -v -tags=disable_codec_libfdk-aac,disable_codec_lame,disable_codec_tta ./... + - go test -cover -v -tags=disable_codec_libfdk-aac,disable_codec_lame,disable_codec_tta,enable_codec_libalac ./... - go test -cover -v -tags=disable_format_aac,disable_format_alac,disable_format_mp3,disable_format_opus,disable_format_tta,disable_format_vorbis ./... ... diff --git a/README.md b/README.md index 3af0581..186949a 100644 --- a/README.md +++ b/README.md @@ -121,6 +121,12 @@ This tag disables the [TTA](https://git.gammaspectra.live/S.O.N.G/go-tta) suppor This is equivalent to `disable_format_tta`. +### enable_codec_libalac +This tag enables the [libalac](https://git.gammaspectra.live/S.O.N.G/go-alac) support for decoding/encoding ALAC. + +This library has vast security issues, enable on your own risk. An alternate codec for decoding might be added in the future. + + ## Licenses ### Kirika diff --git a/audio/format/alac/alac.go b/audio/format/alac/libalac.go similarity index 97% rename from audio/format/alac/alac.go rename to audio/format/alac/libalac.go index 42c6040..a115607 100644 --- a/audio/format/alac/alac.go +++ b/audio/format/alac/libalac.go @@ -1,5 +1,5 @@ -//go:build !disable_format_alac -// +build !disable_format_alac +//go:build !disable_format_alac && enable_codec_libalac +// +build !disable_format_alac,enable_codec_libalac package alac diff --git a/audio/format/alac/alac_test.go b/audio/format/alac/libalac_test.go similarity index 87% rename from audio/format/alac/alac_test.go rename to audio/format/alac/libalac_test.go index 97c79b5..f442bd3 100644 --- a/audio/format/alac/alac_test.go +++ b/audio/format/alac/libalac_test.go @@ -1,5 +1,5 @@ -//go:build !disable_format_alac -// +build !disable_format_alac +//go:build !disable_format_alac && enable_codec_libalac +// +build !disable_format_alac,enable_codec_libalac package alac diff --git a/audio/format/guess/init_alac.go b/audio/format/guess/init_alac.go index 75b73af..699fcae 100644 --- a/audio/format/guess/init_alac.go +++ b/audio/format/guess/init_alac.go @@ -1,5 +1,5 @@ -//go:build !disable_format_alac -// +build !disable_format_alac +//go:build !disable_format_alac && enable_codec_libalac +// +build !disable_format_alac,enable_codec_libalac package guess