| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
| |
Fixes https://github.com/xiph/flac/issues/428
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
Add options --keep-foreign-metadata-if-present and improve error
messages when on decoding the wrong type of foreign metadata is
found.
|
|
|
|
| |
This fixes https://github.com/xiph/flac/issues/376
|
| |
|
| |
|
|
|
|
| |
Signed-off-by: Ralph Giles <giles@thaumas.net>
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
| |
If the user specifies `--no-error-on-compression-fail`, there is no need
to treat compression failure as an error. Hence, the failure message
should be suppressed along with the non-zero exit code (which already
is suppressed).
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When encoding a 24 bit multichannel W64 file on a 32 bit system, a
calculation could overflow resulting in a "got partial sample"
error and early termination of the encoding process.
The fix was to replace the cast to `size_t` (which is only 32 bits
on a 32 bit system) with a cast to `uin64_t`.
Thanks to Janne Hyvärinen for helping to track down the problem.
Closes: https://sourceforge.net/p/flac/bugs/453
|
| |
|
| |
|
|
|
|
|
|
|
| |
This prevents a too large padding value overflowing the block length.
Patch-from: lvqcl <lvqcl.mail@gmail.com>
Closes: https://sourceforge.net/p/flac/bugs/284/
|
|
|
|
| |
Patch-from: lvqcl <lvqcl.mail@gmail.com>
|
|
|
|
| |
Patch-from: lvqcl <lvqcl.mail@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
A malformed file (generated by AFL) had a 'samples_left_to_process' value
of greater than the actual numbe of samples. When re-encoding the decoder
would get to the end of the file and then continuously return a decode
status of FLAC__STREAM_DECODER_END_OF_STREAM, causing an infinite loop.
Solution is to break out of the loop on two consecutive end-of-stream
events.
|
|
|
|
|
|
|
|
| |
* flac/encode.c : Validate num_tracks field of cuesheet.
* libFLAC/stream_encoder.c : Add check for a NULL pointer.
* flac/encode.c : Improve bounds checking.
Closes: https://sourceforge.net/p/flac/bugs/425/
|
|
|
|
|
|
|
| |
This commit fixes a typo in a console debug message encountered during
encoding. It also fixes a grammatical error in the same message.
Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
|
| |
|
|
|
|
|
|
|
|
| |
MSVC6 was not able to cast from a uint64_t to a double and this
commit removes some #ifdef hackery designed to work around this
problem.
Patch-from: lvqcl <lvqcl.mail@gmail.com>
|
|
|
|
| |
Patch-from: lvqcl <lvqcl.mail@gmail.com>
|
|
|
|
| |
Use the union of pointers trick again.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* The default channel mask for mono files was 0x0001 (front left) but it
makes more sense to use 0x0004 (front center) for such files.
* Also FLAC will accept not only mono WAV files with 0x0001 mask, but also
with 0x0002 (requested at https://sourceforge.net/p/flac/bugs/390/)
and 0x0004 (e.g. SoX creates mono files with this mask).
* The comment about channel support was updated.
* The error message
"Use --channel-map=none option to store channels in current order; FLAC files
must also be decoded with --channel-map=none to restore correct order."
is misleading: FLAC never changes the order of channels.
Decoding with this options also sets the channel mask of the resulting WAV
file to 0. Without this option the mask is equal to the value of
WAVEFORMATEXTENSIBLE_CHANNEL_MASK tag.
Patch-from: lvqcl <lvqcl.mail@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem discussed here:
http://lists.xiph.org/pipermail/flac-dev/2014-June/004808.html
The values for the interval between two updates (e->stats_mask,
e->stats_frames_interval) were set ~10 years ago, and it is small
for current CPUs. It was now been increased too (0x3f -> 0xff, etc).
The update interval is still less than 1 second.
Patch-from: lvqcl <lvqcl.mail@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Patches ported from the flac 1.2.1 maintenance branch.
http://flac.cvs.sourceforge.net/viewvc/flac/flac/src/flac/encode.c?
r1=1.194&r2=1.194.2.1&pathrev=FLAC_RELEASE_1_2_1_MAINTENANCE_BRANCH
http://flac.cvs.sourceforge.net/viewvc/flac/flac/src/flac/main.c?
r1=1.169&r2=1.169.2.1&pathrev=FLAC_RELEASE_1_2_1_MAINTENANCE_BRANCH
Patch-from: lvqcl <lvqcl.mail@gmail.com>
|
|
|
|
|
|
|
| |
Sourceforge.net links updated as nedeed with some of them
being changed to point to xiph.org/flac.
Patch-from: lvqcl <lvqcl.mail@gmail.com>
|
|
|
|
|
|
|
| |
* 'norrmal' -> 'normal'.
* 'fames' -> 'frames'.
Reported-by: lvqcl <lvqcl.mail@gmail.com>
|
|
|
|
|
|
| |
Should be '#ifdef HAVE_CONFIG_H'.
Closes: https://sourceforge.net/p/flac/bugs/410/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
MSVS profiler shows that the encoder spends too much time inside format_input()
when the input is 24-bit. Increases encoding speed:
FLAC -5: from 27.1 to 24.2 seconds
FLAC -8: from 76.2 to 73.1 seconds
(MSVS 2010, 32-bit flac.exe, 24-bit stereo input file)
For GCC compiles the encoding speed remains the same. I suspect that GCC is
smart enough to use strict aliasing rule to optimize the code, and MSVS doesn't
even know about it.
Path-from: lvqcl <lvqcl.mail@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Previously the flac executable would return a non-zero exit code when the
output file was bigger than the input file and this could be disabled with
the --no-error-on-compression-fail option.
New beaviour is to print the failure message but return a zero exit code
in the above situation, and only return a non-zero exit code with the
--error--on-compression-fail option. The --no-error-on-compression-fail
command line option has been retained.
|
|
|
|
|
|
| |
As suggested by Brian Willoughby this is not an "ERROR" but a "FAILURE".
Also list a couple of possible causes of this failure and remove the
suggestion to contact the developers.
|
|
|
|
|
| |
This is designed for the test suite where a number of artificially created
files end up bigger than the original.
|
|
|
|
|
|
| |
Stash the compression ratio in the EncoderSession struct and at the
end of the encode process, check if its > 1.0. Print an error message
if it is.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Patch from Janne Hyvärinen <cse@sci.fi>.
|
| |
|
|
|
|
| |
GUID had one word incorrectly in little endian order.
|
|
|
|
| |
Patch submitted by Janne Hyvärinen <cse@sci.fi>.
|
| |
|
|
|
|
|
|
|
| |
The files src/flac/encode.c and src/libFLAC/stream_encoder.c use
functions in libFLAC that are marked as 'unpublished debug routines'.
This patch moves these functions to new file include/share/private.h
and marks them as 'unpublished debug routines'.
|
|
|
|
|
|
|
|
|
|
|
| |
This commit accepts the new default channel masks for 6.1 and 7.1
surround input WAV files, and writes the corresponding masks when
decoding to WAV without a channel mask from the metadata block.
The local copy of the format spec is also updated with the new text
from the flac-website repository.
Patch from Ralph Giles <giles@mozilla.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
WAVEFORMATEXTENSIBLE format.
MinGW's fseeko() doesn't return error for the attempt to seek on non
seekable file (same behavior as MSVC).
The simplest solution would be to change #ifdef _MSC_VER to #ifdef
_WIN32 here.
Instead, this patch tests file with fstat(), and use fseeko() only when
it is a regular file.
This is confirmed to work properly both on MSVC and MinGW, can seek if
stdin is a redirected regular file, and doesn't require #ifdef.
Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
|