Commit Graph

3710 Commits

Author SHA1 Message Date
Erik de Castro Lopo ef9f7998fd src/libFLAC/lpc.c : Restore missing conditional.
Git commit 9c2290ade5 in-correctly removed a conditional around
an fprintf. Thanks to mark4o on #xiph (freenode) for reporting
this.
2015-03-31 10:14:17 +11:00
Erik de Castro Lopo 7566d3d4c1 configure.ac : Tweak for x32 architecture.
The x32 architecture uses and ILP32 (32 bit ints, longs and pointers)
on an x86_64 CPU. Since the CPU is x86_64 we need to set FLAC__CPU_X86_64
even though the pointer size is 32 bits.

Patch-from: Stuart Shelton
Closes: https://sourceforge.net/p/flac/bugs/427/
2015-03-12 08:28:01 +11:00
Erik de Castro Lopo 336f6a5429 configure.ac : Fix FLAC__HAS_X86INTRIN / FLaC__SSE_OS.
* Correct definition of FLAC__HAS_X86INTRIN in config.h file.
* Correct comparison of sse_os with 'true' instead of 'yes'.

Patch-from: lvqcl <lvqcl.mail@gmail.com>
2015-02-25 06:48:34 +11:00
Erik de Castro Lopo ab7ab03bfa src/test_streams/main.c : Use flac_snprintf() instead of snprintf().
MSVC doesn't have snprintf().

Patch-from: lvqcl <lvqcl.mail@gmail.com>
2015-02-25 06:48:31 +11:00
Erik de Castro Lopo 64d4322b66 ci/flac-autotool.sh : Test 'distcheck' target instead of 'check'. 2015-02-24 18:32:07 +11:00
Erik de Castro Lopo 1ddeb2640e test/test_flac.sh : Make it work for 'make distcheck'.
An output file was being set to read only and hence could not be
overwritten by a later test. Not sure why this only affected the
'make distcheck' target.
2015-02-24 18:32:07 +11:00
Erik de Castro Lopo 29db3fbf1c Fix cursheet tests for 'make distcheck'. 2015-02-24 06:06:10 +11:00
Erik de Castro Lopo 8267168d28 src/encode.c : Fix potential infinite loop in flac-toflac encoding.
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.
2015-02-22 21:44:27 +11:00
Erik de Castro Lopo ffcda161ad Add file ci/flac-autotool.sh.
Currently only does 'make check' because 'make distcheck' is currently
broken.
2015-02-21 10:04:42 +11:00
Erik de Castro Lopo c431a6c581 libFLAC/metadata_object.c : Fix typo in comment. 2015-02-21 07:05:21 +11:00
Christian Weisgerber b5a10e75ed configure.ac : Detect 'amd64' as being same as 'x86_64'.
On BSD systems, the 64-bit x86 architecture is called "amd64".

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2015-02-19 06:13:01 +11:00
Miroslav Lichvar fed0dfa108 src/libFLAC/stream_decoder.c : Rework fix for seeking bug.
To avoid crash caused by an unbound LPC decoding when predictor order is
larger than blocksize, the sanity check needs to be moved to the subframe
decoding functions.

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2015-02-18 17:19:19 +11:00
Erik de Castro Lopo 033af7bf1c libFLAC : Put upper bound on number of seek points.
Restrict number of seek points to 32768 total and a maximum of two per
second.

Ten hours of content is 36000 seconds which gives about one seek point
for every second for those ten hours. Also, having more than two seek
point per second makes little sense regardless of content length.

Without these restrictions flac-to-flac encoding of a malformed input
file (eg something generated with http://lcamtuf.coredump.cx/afl/)
can result in an attempt to generate a stupidly large number of seek
points and cause an allocation failure.
2015-02-18 10:13:53 +11:00
Erik de Castro Lopo c06a44969c flac : Fix for https://sourceforge.net/p/flac/bugs/425/
* 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/
2015-02-18 09:49:08 +11:00
Erik de Castro Lopo ed22a42bbe test/test_metaflac.sh : Out-of-tree build fixes. 2015-02-15 20:37:40 +11:00
Erik de Castro Lopo d8036ea9d6 test/test_flac.sh : Out-of-tree build fixes. 2015-02-15 20:37:40 +11:00
Erik de Castro Lopo 7c3cd3d908 Update grabbag tests to work out-of-tree. 2015-02-15 20:37:40 +11:00
Erik de Castro Lopo bb2abeaf10 test/test_flac.sh : Silence increased encoding size warnings.
These warning are supposed to occur for files with noise-like
characteristics and some of the tests use files containing noise.
2015-02-15 16:48:46 +11:00
Erik de Castro Lopo bd51618152 test/Makefile.am : Collapse 'fullcheck' into 'check' target. 2015-02-15 16:48:46 +11:00
Erik de Castro Lopo 757ae56140 test/common.sh.in : Add top_builddir and top_srcdir variables.
These are needed for running some of the tests when building out
of tree.
2015-02-15 16:48:46 +11:00
Erik de Castro Lopo b903670f21 replaygain test: Use C code to generate test files. 2015-02-15 16:48:46 +11:00
Erik de Castro Lopo a0277fc637 src/test_streams/ : Pull out write_simple_wavex_header() for reuse. 2015-02-13 10:53:46 +11:00
Erik de Castro Lopo 7ef7b58f04 test/test_replaygain.sh : Minor cleanup.
* Pipe un-needed strerr output to /dev/null.
* Pass --silent and --no-seektable to the flac executable.
* When generating tones, use --output-name=....
2015-02-13 09:30:39 +11:00
Erik de Castro Lopo 875be0ada5 src/libFLAC/stream_decoder.c : Fix NULL de-reference.
NULL de-reference can really only happen on a malformed file.
Found using afl (http://lcamtuf.coredump.cx/afl/).
2014-12-22 09:05:09 +11:00
Erik de Castro Lopo 775eb934f7 src/flac/decode.c : Add WAVEFORMATEXTENSIBLE to WAV files as needed.
Patch-by: lvqcl <lvqcl.mail@gmail.com>
2014-12-14 20:00:37 +11:00
Karthik Periagaram bc97640b65 Grammatical error in make file comment fixed
Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2014-12-14 18:00:05 +11:00
Karthik Periagaram f8255f2b7a Spelling and grammar fixes for console output
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>
2014-12-14 17:59:47 +11:00
Erik de Castro Lopo 18a4854510 stream_decoder.c : Fix free-ing of unitilialized pointer.
Found using afl (http://lcamtuf.coredump.cx/afl/).
2014-12-12 06:51:38 +11:00
Erik de Castro Lopo b4b2910bdc src/libFLAC/stream_decoder.c : Fix seek bug.
Janne Hyvärinen reported a problem with seeking as a result of the
fix for CVE-2014-9028. This is a different solution to the issue
that should not adversely affect seeking.

This version of the fix for the above CVE has been extensively fuzz
tested using afl (http://lcamtuf.coredump.cx/afl/).

Reported-by: Janne Hyvärinen <cse@sci.fi>
2014-12-11 11:17:03 +11:00
Erik de Castro Lopo 3ff1b9d3f0 flac/vorbiscomment.c : Fix typo.
Patch-from: Jan Stary <hans@stare.cz>
2014-12-09 06:04:49 +11:00
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