Commit Graph

3952 Commits

Author SHA1 Message Date
Ralph Giles 1151c93e99
Update maintainer statement.
Erik hasn't had time to look after the repo lately. We continue
as we can.
2022-02-20 09:46:15 -08:00
Martijn van Beurden 29e5b50789
Change sourceforge URL in flac error messages to github
Signed-off-by: Ralph Giles <giles@thaumas.net>
2022-02-13 21:22:01 -08:00
Ralph Giles fe87159c6f
Set release date in the changelog.
Missed this in the previous commit.
2022-02-13 21:17:18 -08:00
Ralph Giles dd8777d1fd
Set release date for 1.3.4.
This is a target date, but it's a nice round number if we're able
to make it work.
2022-02-13 20:46:46 -08:00
Martijn van Beurden 73ed8d6e07
Change version to 1.3.4 and add placeholders for release date
Signed-off-by: Ralph Giles <giles@thaumas.net>
2022-02-13 20:42:11 -08:00
Martijn van Beurden dee83e0633
Add 1.3.4 to changelog
Signed-off-by: Ralph Giles <giles@thaumas.net>
2022-02-13 20:42:11 -08:00
Ralph Giles bbdb0b0d47
Revert "libFLAC: Rename get_client_data_from_decoder function"
Remove this from the 1.3.x release branch since it's an API
change. Backward-compatible, but still. This change should
instead be released as part of flac 1.4.0.

This reverts commit 4ca0d85c5d.

Signed-off-by: Martijn van Beurden <mvanb1@gmail.com>
2022-02-13 20:38:36 -08:00
Ralph Giles ef5c89e705
Revert "move the new public get_decoder_client_data function to public header."
Remove this from the 1.3.x release branch since it's an API
change. Backward-compatible, but still. This change should
instead be released as part of flac 1.4.0.

This reverts commit 19a0e99ac3.

Signed-off-by: Martijn van Beurden <mvanb1@gmail.com>
2022-02-13 20:38:36 -08:00
Ralph Giles f50609fc55
Run CIFuzz on the 1.3.x release branch.
Make sure we have coverage when working on backports to the
older stable API series.
2022-02-13 20:38:33 -08:00
Martijn van Beurden e8143ab527
Add CIFuzz to workflows
Signed-off-by: Ralph Giles <giles@thaumas.net>
2022-02-10 20:10:59 -08:00
Martijn van Beurden 79e462fb61
Check that blocksize is evenly divisible by 2^(partition order)
Credit: Oss-Fuzz
Issue: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=38815

Signed-off-by: Ralph Giles <giles@thaumas.net>
2022-02-08 20:49:14 -08:00
Martijn van Beurden 2f209573d0
Check for predictor order <= blocksize in subframe header
Credit: Oss-Fuzz
Issue: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=38347

Signed-off-by: Ralph Giles <giles@thaumas.net>
2022-02-08 20:49:13 -08:00
Martijn van Beurden d4a7221046
Mark fixed subframes with bps > 24 as unparsable
Like 1fd178e, decoding fixed subframes with bps > 24 results in
integer overflow

Signed-off-by: Ralph Giles <giles@thaumas.net>
2022-02-08 20:49:12 -08:00
Martijn van Beurden aa126b8f2f
Mark 32 bps stream with stereo decorrelation as unparsable
Credit: Oss-Fuzz
Issue: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19234

Signed-off-by: Ralph Giles <giles@thaumas.net>
2022-02-08 20:49:11 -08:00
Neelkamal Semwal e1575e4a7c
libFlac: Exit at EOS in verify mode
When verify mode is enabled, once decoder flags end of stream,
encode processing is considered complete.

CVE-2021-0561

Signed-off-by: Ralph Giles <giles@thaumas.net>
2022-02-08 20:49:09 -08:00
Martijn van Beurden 479f6038d9 Make decoder more fuzzer-friendly by disabling frame checks on fuzzing
This commit disables CRC and zero-bit checking when
FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION is defined
2022-02-08 20:24:32 -08:00
tmkk b358381a10
cpu.h: detect AVX/FMA intrinsics availability on clang
Previously the FLAC__AVX2_SUPPORTED macro is defined, but actually
AVX2 functions are not used when built with clang because flac only
uses them when FLAC__AVX_SUPPORTED macro is set.

Signed-off-by: NotTsunami
2021-07-24 22:15:17 -07:00
Ralph Giles 313ab5852f github actions: Add dummy ctest config switch.
This is required on windows, but not on other platforms.
It needs to be the default `Debug` target, rather than
`Release` to match CMAKE_BUILD_TYPE, for the $TARGET_FILE
mapping to produce the correct path.

See https://gitlab.kitware.com/cmake/cmake/-/issues/20283
2021-07-11 13:53:07 -07:00
Ralph Giles 10797d5896 cmake: add some simple tests on windows platforms.
The main test harnesses are written in unix shell script, so
they don't work on windows. A stanza was added to the cmake
config to skip all tests there to get a green build.

This is misleading, since no testing was done at all on Windows.

Instead, construct a separate set of tests on non-unix platforms,
calling the two api test programs, which of necessity are
compiled executables. Also invoke the two front-end programs
with just the --help switch to verify they at least start.

Thanks to Marcus Asteborg for the suggestion.
2021-07-11 13:53:07 -07:00
Ralph Giles bac77f73f2 github actions: Split CMake build into separate steps.
Failures within multi-line commands aren't detected properly
in the windows runner environment. Therefore split each
line into a separate step for the cmake build.

Use the `working-directory` key to mark the build subdir without
having the prepend a `cd` command.
2021-07-11 13:53:07 -07:00
Ralph Giles 21a217e737 github actions: add a windows cmake target
Make use of the available builders for Microsoft Windows build
converage.

Unfortunately this job reports finding no tests to run, despite
being identical to other builds. Worse, this is not reported as
an error.

Windows doesn't have a package manager like linux and macos, so
until we figure out how to build and cache the ogg dependency
for the windows job, just skip ogg support.
2021-07-11 13:53:07 -07:00
Ralph Giles df35f5ea41 github actions: archive logs on failure.
The test harnesses log details to files during the run,
which is helpful when debugging issues which are only
reported as a run failure in the console output.

When the build job fails, upload an artifact consisting
of a zipfile with all the log files from the build,
so users can investigate test failures in ci more
easily.
2021-07-11 13:53:07 -07:00
Ralph Giles 37d1a620eb github actions: Fix typo.
This doesn't change the build; it just corrects a label.
2021-06-26 05:12:56 +00:00
Ralph Giles b7a4402aeb gitlab-ci: Add build configs.
Define builds for gitlab's continuous integration runners so we
some feedback on versions of the code hosted there, particularly
https://gitlab.xiph.org/xiph/flac.

Build with GNU Autotools, with CMake+ninja, and verify
the Makefile.lite build.

This uses the same Debian-based docker.io/library/gcc:9 container
image we use for most of the codec projects. That container
doesn't specify an unprivileged user so that we can install
packages.

However, some of flac's file-creation tests must be run as an
unprivileged user who owns the source tree. We therefore
create a user account and use `su` to run the tests.

In the case of the autotools job, `make distcheck` unpacks
the packaged source, so this takes care of ownership.

In the case of the other jobs, we must `chown` the entire
checkout and complete the build as the unprivileged user.

Another way to address this would be to define a custom
container image with the prerequisites installed before
switching to an unprivileged user for the entire build.

The current approach was simpler to get working.
2021-06-26 05:12:56 +00:00
TGMarkiewicz bab58c374f Fix building/installing docs with CMake
Details:
 - During the installation of the package with CMake, it stops
   (via fail) when doc files should be copied. It was caused by
   changing current binary to current source CMake directory.
2021-06-24 15:59:31 -07:00
TGMarkiewicz 1ac2a6314b Fix version & requires fields in pkg config files
Details:
 - When building with CMake, pkg-config files flac.pc and flac++.pc
   are not updated with Version information. This causes a failure
   when running a configure script in opus-tools
   (https://github.com/xiph/opus-tools).

   Note that OGG_PACKAGE is set to "ogg" exactly as in the configure.ac,
   but it is only set when the building explicitly with libogg.
2021-06-24 15:59:09 -07:00
Andrey Astafyev a9557c13fa
examples: Fix error condition processing
Don't attempt to attach failed metadata objects. This also avoids
clobbering the error flag if attaching the objects should succeed.

There may still be problems later, for example calling _delete()
on a possibly null metadata object pointer, but this it at least
and improvement in the compromise between error handling and
readability in C.

Signed-off-by: Ralph Giles <giles@thaumas.net>
2021-06-23 13:24:22 -07:00
Ewout ter Hoeven eba0ff8d3e
CI: Run on pull requests and once a month
Run the CI on PRs and once a month (to detect failures due to updated images or dependencies).

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
Signed-off-by: Ralph Giles <giles@thaumas.net>
2021-06-22 22:52:45 -07:00
Chocobo1 88fb432a0f
Fix nasm.h not found when building in x86
The following is the error from compiler:
Assembling cpu_asm.nasm
  cmd.exe /D /C "C:\Users\appveyor\AppData\Local\Temp\1\tmp62cb769c16c04b79a2f73246c8ccf95a.cmd"
  "/NASM/nasm.exe" -o "FLAC-asm.dir\Release\cpu_asm.obj" -fwin32 -I"C:\project\lib\flac\include\\" -I"C:\project\lib\flac\_build\Win32\\" -D"CMAKE_INTDIR="Release"" -dOBJ_FORMAT_win32 "C:\project\lib\flac\src\libFLAC\ia32\cpu_asm.nasm"
  C:\project\lib\flac\src\libFLAC\ia32\cpu_asm.nasm:34: fatal: unable to open include file `nasm.h'

Closes #220.

Signed-off-by: Ozkan Sezer <sezeroz@gmail.com>
2021-06-22 22:44:18 -07:00
Ralph Giles 88bb6d49a4
Merge pull request #244 from maxz/fix-wrongly-encoded-characters
Fix encoding of contributor name.
2021-06-22 10:44:29 -07:00
Max Zettlmeißl d73631d1ca Fix encoding of contributor name.
The name of Håvard Kvålen was wrongly encoded.
2021-06-22 15:54:09 +02:00
Erik de Castro Lopo 27c615706c github actions: Drop HTML validation
Its seems `xmllint` is mainly an XML validator and not a HTML validator
and can't find a decent command line HTML validator.
2021-03-15 13:46:20 +11:00
Martijn van Beurden ae288c067c Fix compression ratio display for very small files
Because the compression ratio was calculated before processing
the input of the last frame, it did not include the size of this
last frame. This patch moves the calculation of the compression
ratio after the new input has been processed. Now the compression
ratio on very small files is correctly displayed.
2021-03-15 13:46:20 +11:00
Martijn van Beurden ced7f6829d Add some overflow checks for residual bits calculation 2021-03-15 13:46:20 +11:00
Martijn van Beurden 38b7fec143 Change analyse function to support >4Gbit frames
Theoretically, when a rice parameter of 0, 24-bit samples, fixed
predictor with order 0, no rice escaping and a blocksize of 65536
is chosen, a subframe could be up to 2^24*65536 = 1 terabyte in
size. While this obviously should never happen, the analyse
function should be able to debug such a case.
2021-03-15 13:46:20 +11:00
NotTsunami 5f5035d209 flac: Work around gcc bug to prevent false unset MD5 signature warning
A bug beginning in gcc version 9.2 causes strings to get incorrectly
stripped when passed directly to memcmp with a zero first byte (1).
This bug causes flac -t to fail on any .flac file with a md5 checksum
beginning in 00. To work around this bug, the FLAC__byte type is used
for an empty md5 sum to prevent a string from being stripped, which
is backwards compatible and avoids compile-time checks. This was
initially reported back in March 2020, but has seen more light since
Ubuntu 19.10 and up ship with gcc 9.2 as the default compiler. A
patch has been merged into the master gcc branch (2), but has not
been included in any versions as of this commit date.

The initial reporter provided a patch in their bug report (3), which
is included in this PR with authorship attributed to the reporter.

(1) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95189
(2) https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=d5803b9876b3d11c93d1a10fabb3fbb1c4a14bd6
(3) https://sourceforge.net/p/flac/bugs/478/

Closes #192.
2021-03-15 13:46:20 +11:00
Neelkamal Semwal d7b33142ec libFLAC/stream_decoder.c: Fix divide by zero error in FLAC__stream_decoder_seek_absolute 2021-03-15 13:46:20 +11:00
Robert Kausch 159cd6c41a libFLAC/stream_decoder.c: Use current position as bound when seeking 2021-03-15 13:46:20 +11:00
Tim Gates bfd4f13f3e
docs: fix simple typo, opertator -> operator
There is a small typo in oss-fuzz/fuzzing/datasource/datasource.hpp.

Should read `operator` rather than `opertator`.

Signed-off-by: Ralph Giles <giles@thaumas.net>
2020-12-17 11:05:31 -08:00
evpobr ce6dd6b573 CMake polishing
* Improve CPU features detection

  CMAKE_SYSTEM_PROCESSOR is pretty useless (e.g. when compiling with
  MSVC ARM64 toolchain and Ninja still returns system processor).

* Don't build src/utils targets by default

  Fix compilation for UWP platform.

* Add more Visual studio Git ignore patterns
* Autogenerate Doxygen docs
2020-05-14 13:56:01 +10:00
Ulrik Mikaelsson 37e675b777 Simplified logic of parsing sizes of rice-partitions
> if the partition order is zero, n = frame's blocksize - predictor order
> else if this is not the first partition of the subframe,
>   n = (frame's blocksize / (2^partition order))
> else n = (frame's blocksize / (2^partition order)) - predictor order

if the partition order is zero, then partition_number can only be zero
if the partition order is zero, then
  (frame's blocksize / (2^partition order))
  is (frame's blocksize / 1) == frame's blocksize
2020-05-03 17:16:19 +10:00
Thomas BERNARD 4fbb6d4f2e fix build under Mac OS X with PowerPC CPU
revert 44036c9a9b because auxv.h is only
available under Linux and FreeBSD.
2020-05-03 17:14:33 +10:00
evpobr e0b62a61a7 Bunch of CMake fixes
* Add more Git ignore patterns
* Fix Ogg dependency handling (closes #203)
* Remove unneeded compiler flag (closes #204)
* Fix Visual Studio DLL build error error C2491:
  'flac_internal_rename_utf8': definition of dllimport function not
  allowed (closes #205)
* Add alias targets
* Reduce number of CMake files
* Improve CMake intrinsics detection
2020-05-03 17:13:50 +10:00
evpobr 7a35c52849 cmake: Fix pkg-config install path
Path was accidentally broken in acadefd.

Closes #200.
2020-04-07 18:13:01 +10:00
evpobr dd975a9ea8 Integrate Github Actions 2020-04-07 06:52:26 +10:00
evpobr acadefddac Add more CMake options
* BUILD_PROGRAMS
** INSTALL_MANPAGES
* INSTALL_PKGCONFIG_MODULES
* INSTALL_CMAKE_CONFIG_MODULE
2020-04-05 19:31:40 +10:00
ericLemanissier 1d5299d67b link lm publicly to FLAC 2020-03-06 16:00:17 +11:00
Tamás Zahola cffe3890c7 Fix nullptr dereference in FLAC++ 2019-12-27 11:34:06 +11:00
Vitaliy Kirsanov 0dfe23504c CMake: Handier way to find Iconv 2019-12-22 22:09:03 +11:00
Andrey Astafyev a3d8927c2b Correct printf specifiers to unsigned int where needed 2019-12-09 06:13:11 +11:00