Commit Graph

595 Commits

Author SHA1 Message Date
Martijn van Beurden 4469640b95 Allow alloccheck to keep failing 2024-08-27 16:34:15 +02:00
Jesper Larsson 1880f21066 don't just pass 0 for samples in Ogg/FLAC callback
This is a fix for https://github.com/xiph/flac/issues/661
2024-08-27 08:49:31 +02:00
Martijn van Beurden 8c244b8389 Add level 0 Ogg reading capability to tests and docs 2024-07-18 08:16:39 +02:00
Martijn van Beurden de8bbb0d5b
Update copyright to 2024 (#722) 2024-07-11 15:35:32 +02:00
Martijn van Beurden 9977773a60 Address two Clang warnings 2024-07-10 19:38:09 +02:00
Steve Lhomme 9977bb5b77 include/share/compat.h : use fseek if fseeko is not available 2024-04-22 14:37:41 +02:00
Martijn van Beurden 8cf7e7fbb5 Update API version numbers and ABI dumps 2023-09-22 21:10:15 +02:00
Martijn van Beurden c227be6c12 Add multithreading to libFLAC++ and more fuzzers 2023-09-22 21:10:15 +02:00
Martijn van Beurden d2f0a1a812 Add multithreading to API documentation and man page 2023-09-22 21:10:15 +02:00
Martijn van Beurden acf6f8ff11 Add multithreading to libFLAC 2023-09-22 21:10:15 +02:00
Martijn van Beurden d80e574451
Explain use of errno with callbacks 2023-06-16 06:46:57 +02:00
Martijn van Beurden e00d9b881f
Update copyright year and maintainer status 2023-06-06 22:08:24 +02:00
Martijn van Beurden fd890034a5
Fix compression level 8 in API docs 2023-06-01 19:16:03 +02:00
Martijn van Beurden 1619af5a36
Update changelog and library version numbers 2023-05-30 07:41:35 +02:00
Martijn van Beurden 22fffdceb8 Check for overflow when multiplying skip samples with sample size
Credit: Oss-Fuzz
Issue: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=58606
2023-05-08 19:39:08 +02:00
Martijn van Beurden 00cb41ee03 Add use of x86 BMI2 to bitreader_read_rice_signed_block 2023-03-27 22:10:00 +02:00
Martijn van Beurden b11677e052 Add API function FLAC__metadata_object_set_raw
Add an API function to directly input binary FLAC data to get a
FLAC__StreamMetadata struct. The use mirrors
FLAC__metadata_object_get_raw
2023-03-19 22:37:40 +01:00
Martijn van Beurden b54eabdf0d Add API function FLAC__metadata_object_get_raw
Add an API function to directly output binary FLAC data corresponding
to a certain FLAC__StreamMetadata struct
2023-03-19 22:37:40 +01:00
Martijn van Beurden 8daf62da0c Rename fuzzer source files to simplify oss-fuzz build script 2023-02-21 15:56:40 +01:00
Martijn van Beurden 3baaf23faa
Add warning that md5 functions are used elsewhere 2023-02-21 08:16:46 +01:00
Martijn van Beurden 0a52c6fd5c
Replace own bool with stdbool.h, check for header being available 2023-01-07 09:58:00 +01:00
Martijn van Beurden a73e70c8f4 Also check asserts in fuzzing 2022-11-09 07:19:31 +01:00
Martijn van Beurden 396313c9d0 [doxygen] Change links from local to xiph.org/flac 2022-10-19 17:09:57 +02:00
Ozkan Sezer c0a6701bc0 fix a typo in stream_encoder.h
fixes doxygen error:
include/FLAC/stream_encoder.h:1298: Error: Unexpected character `"'
2022-10-19 17:09:57 +02:00
Martijn van Beurden 3f4ba7620c Change C++ style comments to C style in headers 2022-09-20 19:54:32 +02:00
Martijn van Beurden 87c3d8a0d9 Fix a lot of Doxygen errors and add some documentation 2022-09-20 19:54:32 +02:00
Martijn van Beurden 89a1620c42 Update API and tool docs 2022-09-20 19:54:32 +02:00
Martijn van Beurden dc12a9e2f6
Add struct tag to FLAC__StreamMetadata (#416) 2022-08-29 20:35:19 +02:00
Martijn van Beurden fbb6cb5c07 Add OOM checking to fuzzing 2022-08-20 16:03:53 +02:00
Martijn van Beurden 707dace4bd Leave metadata items untouched if resize function fails 2022-08-20 16:03:53 +02:00
Martijn van Beurden 21fe95ee82 Add and use _nofree variants of safe_realloc functions
Parts of the code use realloc like

x = safe_realloc(x, somesize);

when this is the case, the safe_realloc variant used must free the
old memory block in case it fails, otherwise it will leak. However,
there are also instances in the code where handling is different:

if (0 == (x = safe_realloc(y, somesize)))
    return false

in this case, y should not be freed, as y is not set to NULL we
could encounter double frees. Here the safe_realloc_nofree
functions are used.
2022-08-20 16:03:53 +02:00
lutianxiong b715d7b9fe fix potential memleak 2022-08-20 16:03:53 +02:00
Martijn van Beurden 3022dad831
Fix and warning for MSVC with Windows XP toolset (#399)
A warning and a small workaround is added for building
libFLAC on MSVC with a specific Windows XP targeting toolset.
2022-08-06 20:32:28 +02:00
Martijn van Beurden 05ff569266 Finish porting guide 2022-07-27 22:16:04 +02:00
Martijn van Beurden 42201ae575 Add porting guide stub 2022-07-27 22:16:04 +02:00
Martijn van Beurden 10d7ce268b Bulk update copyright dates to 2022 2022-07-26 16:23:07 +02:00
Martijn van Beurden 67131c04b8 Include stddef.h in compat.h
See https://github.com/xiph/flac/issues/76 for details

Also, move include of stddef.h and stdarg.h up to top of file to
make clear that they are included unconditionally
2022-07-19 17:33:29 +02:00
Martijn van Beurden 633ab36ec5
Small fixes needed for 32-bit capability (#379)
* Change replaygain analysis so it is able to handle 32-bit PCM
* Increase FLAC__REFERENCE_CODEC_MAX_BITS_PER_SAMPLE to 32
* Fix switch-case fallthrough
2022-07-01 07:36:48 +02:00
Martijn van Beurden 9df24ac202 Add 32-bit decoding capability
Decoding for 32-bit files is added, including the ability to decode
a 33-bit side subframe. However, residuals are assumed to be limited
to a 32-bit signed int, the encoder must make sure of this
2022-06-12 18:38:21 +02:00
Martijn van Beurden 1bb80c18da Small make distcheck fixes 2022-05-27 21:59:32 +02:00
Martijn van Beurden e0e9cc58b4 Remove all Visual Studio specific build files 2022-05-27 21:59:32 +02:00
Martijn van Beurden e5e99dcdc2
Simplify and merge win_utf8 files and remove from DLL interface
libFLAC DLLs were exposing windows_unicode_filename.h functions
because flac and metaflac needed to set flac_internal_set_utf8_
filenames. Files windows_unicode_filename.{c/h} and
win_utf8_io.[c/h] are merged, and all non-utf8 parts are removed.

With this commit, the libFLAC DLL interface is the same as the
libFLAC interface of shared libraries on other platforms
2022-05-17 22:05:45 +02:00
Martijn van Beurden becba351f0 Make it possible for fuzzer to disable instruction set optimizations
This should greatly increase code coverage of the encoder fuzzer
2022-05-11 10:34:49 +02:00
Martijn van Beurden 8b148b257e Rename FLAC__get_decoder_client_data to ...
... FLAC__stream_decoder_get_client_data. Also the function
definition was moved to its 'siblings'. This way, the function
fits better in the API with respect to naming.
2022-05-09 17:29:46 +02:00
Martijn van Beurden b5f4a1535c Add API functions to limit minimum bitrate
Quite a lot of decoders have trouble streaming or seeking in a
file with frames that only consist of constant subframes because
of the large difference between the largest and smallest subframe.

To remedy this, this commit makes it possible to disable the use
of constant subframes for the last subframe in case all others are
constant with a new API function. This means the minimum bitrate
for a FLAC file encoded with this function used is raised to
1bit/sample (i.e. 48kbit/s for 48kHz material). This commit also
adds tests to the test suite
2022-05-02 07:59:01 +02:00
Rosen Penev bfe5ff9455 change if checks to ifdef
More similar to the rest of the code.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-04-29 19:17:26 +02:00
Martijn van Beurden 1ca7b38f3c Add FLAC__STREAM_DECODER_ERROR_STATUS_BAD_METADATA 2022-04-20 12:06:42 +02:00
Martijn van Beurden b19ed90a5b
Remove api doc note untrue since commit c9c0d13
This has been untrue for almost 20 years now
2022-04-19 19:05:24 +02:00
Martijn van Beurden 7dd7f94822 Fix building both static and shared libs on MinGW with autotools
When building both static and shared libs on MinGW with autotools,
the build broke down without any error message. This commit makes
such a build work
2022-04-15 09:36:15 +02:00
Con Kolivas 24629435bb Add support in the encoder for up to 20 bit sample rates
Now that many DACs support up to 768kHz, add support for these
sample rates to the encoder. Files produced with these sample rates
are already decodable by the reference decoder. Update documentation
and tests accordingly.
2022-04-13 20:32:08 +02:00