Commit Graph

2488 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
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
Erik de Castro Lopo
71875b0c75 fixed_intrin_sse[23].c : Add new, simpler SSE code.
It's simpler but not faster so it is disabled by default. Maybe it
will be faster on newer CPUs though..

Patch-from: lvqcl <lvqcl.mail@gmail.com>
2014-09-21 09:34:32 +10:00
Erik de Castro Lopo
6abc480387 stream_encoder_intrin_sse[23].c : Optimize of int32 -> uint64 conversion.
Optimizes int32 -> uint64 conversion by doing zero extension (int32 ->
uint32 -> uint64) instead of sign extension (int32 -> int64 -> uint64).

Patch-from: lvqcl <lvqcl.mail@gmail.com>
2014-09-21 08:48:20 +10:00
Yuta NAKAI
97bcc6f51a win_utf8_io.c: Use fputws instead of fwprintf.
Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2014-09-21 08:44:52 +10:00
Erik de Castro Lopo
b373c8ecb4 Minor clean up of win_utf8_io.
Patch-from: lvqcl <lvqcl.mail@gmail.com>
2014-09-21 08:06:48 +10:00
Erik de Castro Lopo
d6d33e21e7 vorbiscomment.c : Do not write empty vorbiscomment fields.
That is, only write vorbis comment fields if they are non-empty.

Patch-from: Janne Hyvärinen <cse@sci.fi>
2014-09-19 17:51:17 +10:00
Erik de Castro Lopo
4fa58808df fixed_intrin_sse[23].c : Simplify XMM -> int64 conversion.
Patch-from: lvqcl <lvqcl.mail@gmail.com>
2014-09-18 21:47:36 +10:00
Erik de Castro Lopo
ed530f6a4a cpu.h : Only define FLAC__SSE_SUPPORTED if FLAC__HAS_X86INTRIN is set.
Patch-from: lvqcl <lvqcl.mail@gmail.com>
2014-09-18 21:47:11 +10:00
Erik de Castro Lopo
b60f16bbc8 Remove old/broken PPC/Altivec code.
* Removes FLAC__lpc_restore_signal_asm_ppc_altivec_16*
  from lpc.h and stream_decoder.c
* Removes PPC-specific code from cpu.c and cpu.h
* Removes PPC stuff from libFLAC/Makefile.lite and build/*.mk
* Removes as/gas/PPC-specific stuff from configure.ac and
  libFLAC/Makefile.am*
* Removes libFLAC/ppc folder and remove "src/libFLAC/ppc*/Makefile"
  lines from configure.ac

Patch-from: lvqcl <lvqcl.mail@gmail.com>
2014-09-17 23:21:39 +10:00
Erik de Castro Lopo
d399e31ec6 win_utf8_io.c : Remove redundant line.
Patch-from: lvqcl <lvqcl.mail@gmail.com>
2014-08-09 13:03:59 +10:00