3464 Commits

Author SHA1 Message Date
Erik de Castro Lopo
50262f5861 Fix two un-related typos. 2014-11-26 20:42:15 +11:00
Erik de Castro Lopo
b147b73eab test/test_compression.sh : Fix for OSX.
On Mac OSX, the 'wc -c' command returns a number with leading whitespace
which then results in a syntax error when the shell parser expects a
number when it really has a string containing a number. The easy fix is
to use string interpolation.

Closes: https://sourceforge.net/p/flac/bugs/420/
Reported-by: Mark Harris <mark.hsj@gmail.com>
2014-11-26 16:29:29 +11:00
Erik de Castro Lopo
ff8a74aa70 Scripts/cross-build-win-binaries.mk : Strip the binaries. 2014-11-26 08:04:58 +11:00
Erik de Castro Lopo
ccdd8fe275 libFLAC/format.c : Fix the date in FLAC__VENDOR_STRING. 2014-11-26 08:03:34 +11:00
Erik de Castro Lopo
39d9791b03 More date fixes. 2014-11-25 20:02:22 +11:00
Erik de Castro Lopo
b83ee75363 Set version to 1.3.1pre1. 1.3.1pre1 2014-11-25 19:10:31 +11:00
Erik de Castro Lopo
6a737a1270 Add file Scripts/cross-build-win-binaries.mk. 2014-11-25 19:10:31 +11:00
Erik de Castro Lopo
bef7381c98 Makefile.am : EXTRA_DIST should contain FLAC-vs2005.sln. 2014-11-25 14:42:36 +11:00
Erik de Castro Lopo
1437391577 Update copyright years to include 2014. 2014-11-25 13:04:30 +11:00
Erik de Castro Lopo
fcf0ba06ae src/libFACL/stream_decoder.c : Fail safely to avoid a heap overflow.
A file provided by the reporters caused the stream decoder to write to
un-allocated heap space resulting in a segfault. The solution is to
error out (by returning false from read_residual_partitioned_rice_())
instead of trying to continue to decode.

Fixes: CVE-2014-9028
Reported-by: Michele Spagnuolo,
             Google Security Team <mikispag@google.com>
2014-11-25 13:03:55 +11:00
Erik de Castro Lopo
288edbb3a1 doc/html/changelog.html : Add attributions and fix a typo. 2014-11-24 21:54:34 +11:00
Erik de Castro Lopo
e09ff328d4 doc/html/changelog.html : Update for 1.3.1 release. 2014-11-24 21:10:27 +11:00
Erik de Castro Lopo
b7017d61a1 Rename Visual Studio solution files.
* FLAC-vs2010.sln -> FLAC.sln
* FLAC.sln -> FLAC-vs2005.sln
2014-11-24 06:06:14 +11:00
Erik de Castro Lopo
93846ee223 examples/c/decode/file/main.c : Add extra error handling.
Michele Spagnuolo provided a file that initially had frames with two
channels but then had a frame with a single channel. This example
program only supports exactly two channels and previously had
insufficient validation.

Closes: https://sourceforge.net/p/flac/bugs/418/
Reported-by: Michele Spagnuolo,
             Google Security Team <mikispag@google.com>
2014-11-20 21:46:57 +11:00
Erik de Castro Lopo
5b3033a2b3 src/libFLAC/stream_decoder.c : Fix buffer read overflow.
This is CVE-2014-8962.

Reported-by: Michele Spagnuolo,
             Google Security Team <mikispag@google.com>
2014-11-20 21:46:39 +11:00
Martijn van Beurden
d8d171705a libFLAC: fix more problems with new window functions
This fixes two problems with handling of out-of-bounds arguments
for the window functions, one of which involving an infinite loop

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2014-11-16 09:11:02 -08:00
Erik de Castro Lopo
9971e7057d Improve description of encoding preset equivalents.
Patch-from: lvqcl <lvqcl.mail@gmail.com>
2014-11-15 09:19:22 -08:00
Erik de Castro Lopo
7efe8f3bb5 metadata_iterators.c : Set status when metadata itereator is not writable.
The status should be FLAC__METADATA_SIMPLE_ITERATOR_STATUS_ILLEGAL_INPUT.

Closes: http://sourceforge.net/p/flac/patches/50/
2014-11-14 23:35:45 -08:00
Martijn van Beurden
cdff952fd8 libFLAC : Add more checks to partial_tukey and punchout_tukey windows.
Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2014-11-13 20:16:26 -08:00
Erik de Castro Lopo
b7d13c0716 include/share/endswap.h : Fix usage of HAVE_BSWAP16.
The code was incorrectly using #ifndef on a value that was always defined
to a value of either 0 or 1.
2014-11-12 07:06:20 -08:00
Martijn van Beurden
3af2f2b39c Update documentation for new compression presets
Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2014-11-11 06:20:43 -08:00
Martijn van Beurden
3d800a5775 Make test_compression a little more forgiving
The retune of compression levels makes this test fail. This is due
to a few approximations used in the encoder that determine which
LP coefficient should result in the smallest file. Differences are
usually very small, but in my case this resulted in compression
level 6 giving a 3 byte bigger file.

This patch lets the compression test pass even if the a compression
level results in a file that is up to 10 byte larger than the
previous level

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2014-11-11 06:20:08 -08:00
Martijn van Beurden
02891daa7a Retune FLAC compression levels
This patch changes a the settings associated with compression
levels 6, 7 and 8. With this patch, -e is no longer used, but
instead apodization functions are added. This should improve
compression with at least 95% of all material while not changing
the speed much. Decoding ways, 6 and 8 stay the same, and 7 is
slowed a bit, which makes it as fast as 8.

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2014-11-11 06:19:23 -08:00
Ralph Giles
69c2318b7b Fix indenting on the bswap32 autoconf macro.
We generally prefer spaces to tabs.

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2014-11-04 21:18:48 -08:00
Ralph Giles
87408b3661 Clean up bswap32 autoconf macro.
Improve 'checking' message and don't hog the cache namespace.

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2014-11-04 21:18:48 -08:00
Ralph Giles
7a671e7c41 Use a configure check for bswap16 instead of gcc version #ifdefs.
Fixes a build problem on apple clang.

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2014-11-04 21:18:48 -08:00
Ralph Giles
1f30b3e711 Add autoconf macro to check for the bswap16 intrinsic.
Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2014-11-04 21:18:48 -08:00
Erik de Castro Lopo
e0fbe71935 stream_encoder.c : Add apodization field to CompressionLevels struct.
Patch-from: lvqcl <lvqcl.mail@gmail.com>
2014-10-16 08:25:33 +11:00
Erik de Castro Lopo
d2de3a1a19 autogen.sh : Use long names for options to autoreconf. 2014-10-16 08:25:29 +11:00
Erik de Castro Lopo
f0a17e965b libFLAC/fixed_intrin_sse2.c : Fix comments.
Patch-from: lvqcl <lvqcl.mail@gmail.com>
2014-10-07 06:34:21 +11:00
Erik de Castro Lopo
11b5d51b63 Add AVX2 CPU support stream encoder.
Patch-from: lvqcl <lvqcl.mail@gmail.com>
2014-10-04 09:42:57 +10:00
Erik de Castro Lopo
a75b870592 Add AVX/AVX2/FMA support to CPU detection code.
Patch-from: lvqcl <lvqcl.mail@gmail.com>
2014-10-04 09:14:21 +10:00
Erik de Castro Lopo
ad2ae45bb7 libFLAC/stream_encoder.c : Reduce about of hackery.
Patch-from: lvqcl <lvqcl.mail@gmail.com>
2014-10-04 09:13:10 +10:00
Erik de Castro Lopo
35c14b10a4 Refactoring and simplifying of CPU detection.
Patch-from: lvqcl <lvqcl.mail@gmail.com>
2014-10-04 09:05:15 +10:00
Erik de Castro Lopo
7cb032c322 Remove support for AMD's 3Dnow.
AMD stopped release new chips withe 3DNow in 2010.

Patch-from: lvqcl <lvqcl.mail@gmail.com>
2014-10-04 09:01:36 +10:00
Erik de Castro Lopo
347afd878c src/libFLAC/window.c : Add 'f' to float literals to avoid compiler warnings.
Patch-from: lvqcl <lvqcl.mail@gmail.com>
2014-10-03 06:51:43 +10:00
Erik de Castro Lopo
d66f6754bf src/flac/decode.c : Decoder buffering improvements on Windows.
On Windows, decoding flac files is also prone to producing fragmented
files. Avoid fragmentation on NTFS by using Windows specific functions to
tell Windows the size of the file beforehand.

Patch-from: Janne Hyvärinen <cse@sci.fi>
2014-10-03 06:45:28 +10:00
Erik de Castro Lopo
e863247777 stream_encoder.c : Only set 10MB output buffer on _WIN32.
Commig 6a6207b52a set the size of the encoder output buffer to 10MB
but this fix is really only needed on Windows, so wrap it in an #ifdef.
2014-09-29 09:06:37 +10:00
Erik de Castro Lopo
25db9b2cce Improve malformed vorbiscomment handling.
A few minor tweaks on a patch from Janne Hyvärinen <cse@sci.fi>.

fixup
2014-09-27 09:28:45 +10:00
Erik de Castro Lopo
cf780068de metaflac : Fix typo in error message.
Patch-from: Janne Hyvärinen <cse@sci.fi>
2014-09-26 06:28:49 +10:00
Erik de Castro Lopo
cf732a8e86 libFLAC/cpu.c : Refactor for readability.
Patch-from: lvqcl <lvqcl.mail@gmail.com>
2014-09-24 06:41:59 +10:00
Erik de Castro Lopo
6a6207b52a stream_encoder.c : Give the encoder a larger stdio buffer.
Windows in particular can experience slow encoding speeds on highly
fragmented disks. Using setvbuf to increase the size of the buffer to
10Meg.

This is probably not needed on Linux/Unix, but is very unlikely to
to cause any negative effects.

Patch-from: Janne Hyvärinen <cse@sci.fi>
2014-09-24 06:35:17 +10:00
Erik de Castro Lopo
142cc51cc7 flac : Add help output for --ignore-chunk-sizes option.
Patch-from: lvqcl <lvqcl.mail@gmail.com>
2014-09-24 06:28:26 +10:00
Erik de Castro Lopo
9572984e87 libFLAC/window.c : Whitespace. 2014-09-23 06:16:31 +10:00
Erik de Castro Lopo
1c7e3f100f Windows specific vsnprintf fixes.
* Changes flac_snprintf (in src/share/grabbag/snprintf.c) and its copy
  local_snprintf (src/libFLAC/metadata_iterators.c) to be almost sane.

* Adds flac_vsnprintf (src/share/grabbag/snprintf.c) and its copy
  local_vsnprintf (src/share/win_utf8_io/win_utf8_io.c).

* Changes stats_print_info in src/flac/utils.c so it uses flac_vsnprintf
  instead of vsnprintf. This makes return value checking unnecessary.

Patch-from: lvqcl <lvqcl.mail@gmail.com>
2014-09-22 18:29:36 +10:00
Erik de Castro Lopo
e0ac5d46f0 win_utf8_io.c : Comment only.
Explains why flac is currently incompatible with extended-length paths.

Patch-from: lvqcl <lvqcl.mail@gmail.com>
2014-09-22 18:25:09 +10:00
Martijn van Beurden
29a28338c3 Add partial_tukey and punchout_tukey apodization functions
Adds two new apodization functions that seem to perform better than
the apodization functions currently in the codebase and fixes three
existing windows as well.

Its important to note that this patch only affects the encoder stage
that evaluates various possible predictors. Audio encoded with these
new windows will still decode with existing legacy decoders.

= Theory =
These functions are used to window the  audio data at the predictor
stage. These news functions enable the use of only part of the signal
to generate a predictor. This helps  because short transients can
introduce noise into the predictor. The  predictor becomes very good
at prediciting one part of the  signal, instead of mediocre for the
whole block.

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2014-09-22 18:03:24 +10:00
Erik de Castro Lopo
ffa55423e0 flac/utils.c : Fix calculation of a tag length.
Patch-from: lvqcl <lvqcl.mail@gmail.com>
2014-09-21 21:11:46 +10:00
Erik de Castro Lopo
ea0d5ddadc lpc_intrin_sse41.c : Optimize decoding 24 bit files on 32 bit platforms.
Patch-from: lvqcl <lvqcl.mail@gmail.com>
2014-09-21 09:54:59 +10:00
Erik de Castro Lopo
fa85e3ce66 lpc_intrin* : Remove unused code.
Which in turn simplifies FLAC__lpc_restore_signal_16_intrin_sse2()
function.

Patch-from: lvqcl <lvqcl.mail@gmail.com>
2014-09-21 09:34:53 +10:00