Commit Graph

3480 Commits

Author SHA1 Message Date
Erik de Castro Lopo
eb753ae5b4 Remove traiing whitespace (mostly .c and .h files).
Patch-from: lvqcl <lvqcl.mail@gmail.com>
2014-12-05 05:52:30 +11:00
Martijn van Beurden
c97e057ee5 Improve LPC order guess
The recent compression preset retuning improved upon most material
but it the few tracks that show regression are usually classical
music. This patch improves compression by improving the LPC order
guess, of which classical music benefits most.

Improvement is 0.007% on average but up to 0.1%. I haven't seen
regressions for any of my test samples.

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2014-12-05 05:50:24 +11:00
Erik de Castro Lopo
ac0b4b4cab Improve encoding speed on older Intel CPUs.
The commit http://git.xiph.org/?p=flac.git;a=commit;h=e9d805dd4374
changed the that calculate autocorrelation. However, the new code
worked slightly (about 4%) slower on Core 2, but with the new
presets the speed decrease can reach ~25%.

This patch enables both old and new functions and chooses between
them at runtime.

Patch-from: lvqcl <lvqcl.mail@gmail.com>
2014-12-04 21:03:06 +11:00
Erik de Castro Lopo
d03c9f46be src/flac/main.c : Fix an output line > 81 characters in length.
Requested-by: lvqcl <lvqcl.mail@gmail.com>
2014-12-04 21:01:23 +11:00
Zoë Blade
7b757e46f2 Fix some minor word duplication
Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2014-12-03 21:43:03 +11:00
Erik de Castro Lopo
723cfa34f2 configure.ac : Relax automake version requirements.
Suggested-by: Jan Stary <hans@stare.cz>
2014-12-01 05:28:18 +11:00
Erik de Castro Lopo
1e4ffabb6e configure.ac : Don't zap '-g' from $CFLAGS.
The '-g' was in-correctly getting zapped from all CFLAGS expressions
including eg:

    -mfloat-gprs=double (for powerpc e500) -> -mfloatprs=double.

Reported-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
2014-11-30 11:56:54 +11:00
Erik de Castro Lopo
43ba7ad05f src/libFLAC/stream_decoder.c : Fix another input validation bug.
If a file says it contains a stupidly large number of vorbis comments,
the stream decoder would try to allocate enough memory which would fail
returning NULL and then write to that pointer anyway. The solution is
to set a hard limit of 10000 vorbis comments and force num_comments to
zero if the number is too large.

Problem found using the afl (american fuzzy lop) fuzzer.

Closes: https://sourceforge.net/p/flac/bugs/421/
Reported-by : Hanno Böck <hanno@hboeck.de>
2014-11-29 18:08:33 +11:00
Erik de Castro Lopo
0e11f73eab Version 1.3.1 final. 2014-11-27 14:04:48 +11:00
Erik de Castro Lopo
585f00a371 Scripts/cross-build-win-binaries.mk : Add a 'clean' target. 2014-11-27 14:04:08 +11:00
Erik de Castro Lopo
5a365996d7 src/libFLAC/stream_decoder.c : Fail safely to avoid a heap overflow.
This fix is closely related to the fix for CVE-2014-9028. When that
fix went public Miroslav Lichvar noticed a similar potential problem
spot in the same function and was able to craft a file to trigger a
heap write overflow.

Reported-by : Miroslav Lichvar <mlichvar@redhat.com>
2014-11-27 13:40:37 +11:00
Erik de Castro Lopo
71b5c02870 examples/*/Makefile.am : Add CLEANFILES line to remove Windows .exe files. 2014-11-27 13:40:37 +11:00
Erik de Castro Lopo
1a7c3fa488 tests/*.sh : Switch back to /bin/sh.
Jan Stary reported that on OpenBSD bash isn't located in /bin/
which means that the test fail. He also noted that there didn't
seem to be anything bash specific in the tests.

This patch takes some suggestions from Jan, plus a few fixes tested
on Debian using the bin/sh provided by bash and dash.

Suggested-by: Jan Stary <hans@stare.cz>
2014-11-27 13:12:17 +11:00
Erik de Castro Lopo
fe494d2dc2 changelog.html : Minor corrections in decoding speed entry. 2014-11-27 09:08:47 +11:00
Erik de Castro Lopo
e0a0c063a7 Normalize some copyright dates strings.
This will make it easier to simply search and replace.
2014-11-27 08:25:31 +11:00
Martijn van Beurden
3bc649de34 Some last copyright year updates and change to open bug list
This updates one rather important mention of the copyright year
(the encoding/decoding progress display) and a few in the
documentation. Furthermore, it updates the open bug list

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2014-11-27 08:16:34 +11:00
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. 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