| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
|
|
|
|
|
|
|
| |
It cannot be called:
https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-getfileinformationbyhandle
We can get the same information with GetFileInformationByHandleEx(FileIdInfo):
https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-getfileinformationbyhandleex
|
|
|
|
|
|
|
|
| |
It cannot be called:
https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-createfilew
There is CreateFile2 which is very similar:
https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-createfile2
|
|
|
|
|
|
|
|
|
|
| |
There's no support for the console. These functions cannot be used
* GetStdHandle(): https://learn.microsoft.com/en-us/windows/console/getstdhandle
* GetConsoleScreenBufferInfo(): https://learn.microsoft.com/en-us/windows/console/getconsolescreenbufferinfo
* WriteConsoleW(): https://learn.microsoft.com/en-us/windows/console/writeconsole
Instead send logs to the debug output
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
This avoids warnings on clang-16 such as:
getopt/getopt.c:315:1: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
exchange (argv)
^
|
|
|
|
|
|
|
|
|
| |
Because of issue https://github.com/xiph/flac/issues/437 compiler
flags are prepended instead of appended, so the user can override
them without altering the CMakeLists.txt.
Also, Clang doesn't support per-function optimize options, so in
CMake the fma file gets that option per-file. This is not supported
by automake.
|
|
|
| |
Fixes https://github.com/xiph/flac/issues/428
|
|
|
|
|
|
| |
As CPU_IS_LITTLE_ENDIAN is used nowehere except in test_libflac,
switch to CPU_IS_BIG_ENDIAN instead, which is actually used in the
code at several places. CMake didn't set the former but does set
the latter.
|
|
|
|
| |
This was never strictly true, but the assert fired in normal use
since commit a2c8ae5
|
|
|
|
| |
Fixes https://github.com/xiph/flac/issues/433
|
| |
|
| |
|
|
|
|
| |
Credit: oss-fuzz
Issue: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=47747
|
|
|
|
| |
This issue popped up in ci-fuzz, unrelated to the PR itself.
|
|
|
|
|
|
| |
For now OOM emulation in fuzzer_metadata is disabled, as I really
want to get as much merged as soon as possible. Need to get back
to this at some point
|
|
|
|
|
| |
In case memory allocation fails or decoding is aborted during
seeking, do not overwrite these states with a seek error
|
| |
|
|
|
|
|
|
|
|
| |
For some reason realloc failing to allocate space to store the
results of entropy partitioning was not handled at all. The realloc
is moved to a spot where it is possible to set encoder state. This
also moves it from deep within a loop to being called only
occasionally
|
|
|
|
| |
Also remove some nearby unused code
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Subdivide_tukey is intended to replace partial_tukey and
punchout_tukey. It works in rougly the same way, but uses a more
efficient algorithm, recyling more data.
subdivide_tukey has 2 arguments, of which 1 is optional. The
first states the maximum number of parts the signal has to be
split up in, the second is the tukey parameter, divided by the
max num of parts.
subdivide_tukey(3) analyses audio with an unsplit block, with the
block split in 2 and split in 3. Here the default p of 0.5 applies
to the smallest parts, so the unsplit block effectively has a p of
0.5/3. subdivide_tukey(3/2e-1) does the same but with p of 0.2.
|
| |
|
|
|
|
|
| |
There was some help text in `flac --explain` which hasn't been
correct for about 20 years already. This is removed, the rest of
the text is reflowed to fit 80 chars standard terminal width
|
|
|
| |
FreeBSD doesn't have getauxval().
|
|
|
|
| |
A warning and a small workaround is added for building
libFLAC on MSVC with a specific Windows XP targeting toolset.
|
|
|
|
|
| |
The functions these libs provide don't seem to be used on Windows
anyway. This fixes https://github.com/xiph/flac/issues/249
|
| |
|
|
|
|
|
|
|
| |
This might fix https://github.com/xiph/flac/issues/48 I cannot
check as I don't have a file to test with. Besides returning an
empty string upon reading, also allocate empty strings when growing
vorbiscomments
|
| |
|
|
|
| |
See https://github.com/xiph/flac/pull/387 for details
|
|
|
|
| |
This fixes https://github.com/xiph/flac/issues/393
|
|
|
|
|
|
|
|
| |
In 2003, in commit 94f81b0, a check was added for the block align
field in WAVE. If it contradicts other parts of the header, an error
was raised. This was (probably erroneously) made inactive with #if 0
in commit 13c63e4. This commit reactivates the check and removes the
rest of the inactivated code.
|
|
|
|
|
|
|
| |
This reverts commit 7e0a0e572305e9004a6fa9bba3dd6be936553b03,
following the change to the FLAC format proposed here:
https://github.com/ietf-wg-cellar/flac-specification/pull/148
It turns out supporting use of INT32_MIN is quite a hassle.
|
| |
|
|
|
|
|
|
|
|
|
| |
In simple_iterator_prime_input_ there was no check whether the first
metadata block is a streaminfo block. As the rest of the functions
operate under the assumption the first block is a streaminfo block,
for example to prevent the functions from deleting the last block
and being left with an iterator pointing nowhere, this check is
added.
|
|
|
|
|
|
|
| |
When a metadata chain was read from an Ogg FLAC file containing no
metadata (but otherwise valid), an empty chain could be returned,
leading to null derefencing on trying to manipulate it. This commit
adds a check for the chain length
|
| |
|
|
|
|
|
|
| |
In commit 0077d3b checks were added for metadata reading in the
stream decoder. However, the metadata interface suffers from the
same problems. Similar to the mentioned commit, checks are added.
|
|
|
|
|
|
| |
As abs(INT32_MIN) is undefined, it took some extra work to enable
the encoder to do this. While expected gains are zero, this is
done to ensure full spec coverage in this regard
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
|
|
|
| |
FLAC seekpoints are coded in unsigned 64-bit ints, but the code
handling them uses signed 64-bit ints. Since users are unlikely
to run into this limit anyway, do not use seekpoints larger than
INT64_MAX
Credit: Oss-Fuzz
Issue: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=48112
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Commit 3fc5ba4 replaced a seeking error with specific handling.
This handling consisted of lowering the upper seek bound.
However, this handling was both slow and wrong. Because it is slow
it causes fuzzing timeouts. It was wrong in that if there was
another valid frame in the boguss frame being read, it would no
longer be reachable.
This commit replaces the handling with another approach: instead of
lowering the upper bound, the lower bound is raised. With this, the
calculation of pos for the next seek is changed and the seeking code
hopefully ends up somewhere not decoding the bogus frame.
If in decoding the frame at lower bound eof is still reached,
a seek error is thrown. This is reasonable, as lower bound should
be after the end of the last frame (not somewhere halfway a frame)
and if a corrupt frame is encountered, proper seeking cannot be
reasonably expected. It could be argued that it is still possible
to try and lower the upper bound by trying to decode a frame by
moving one byte backward at a time, looking for a frame, but this
will probably cause fuzzer timeouts and as said, proper seeking
in such a stream cannot be reaonably expected.
Credit: Oss-Fuzz
Issue: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=48077
|
|
|
|
|
|
| |
Add options --keep-foreign-metadata-if-present and improve error
messages when on decoding the wrong type of foreign metadata is
found.
|
|
|
|
|
|
|
| |
Without this patch, the order of the arguments matter, with it
it does not: specific compression settings now always override
the more generic compression levels. This fixes issue
https://github.com/xiph/flac/issues/20
|
|
|
|
| |
This fixes https://github.com/xiph/flac/issues/370
|
|
|
|
| |
This fixes https://github.com/xiph/flac/issues/376
|