Commit Graph

3524 Commits

Author SHA1 Message Date
Mario Sanchez Prada
5ff15bddeb configure.ac : Pass -fno-inline-small-functions when using GCC 4.7
For some reason, the build fails when using GCC 4.7 due to the implicit
-finline-functions option passed to the compiler when -O3 is enabled,
which does not happen in newer versions of GCC, probably due to some of
the "General Optimizer Improvements" included in 4.8 (see [1]).

Fortunately, we don't need to disable -finline-functions completely but
just do it for "small functions", which is what this patch does.

[1] https://gcc.gnu.org/gcc-4.8/changes.html

Closes: https://sourceforge.net/p/flac/bugs/429/
Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2015-07-08 22:20:52 +10:00
Erik de Castro Lopo
0cacc0c09f libFLAC/metadata_object.c: Assign NULL after free()
Patch-from: lvqcl <lvqcl.mail@gmail.com>
2015-07-06 21:30:58 +10:00
Erik de Castro Lopo
a45af0ceaf libFLAC/md5.c: Minor formatting fixes
Patch-from: lvqcl <lvqcl.mail@gmail.com>
2015-07-06 21:29:40 +10:00
Erik de Castro Lopo
ff50779e44 libFLAC: More comment validation
When the allocation for obj->comment fails, set obj->num_comments
to zero.

Patch-from: lvqcl <lvqcl.mail@gmail.com>
2015-07-05 21:21:48 +10:00
Erik de Castro Lopo
5e66846a54 Makefile.am: Remove old cruft 2015-07-05 20:59:15 +10:00
Erik de Castro Lopo
d939b44a20 libFLAC: Improve fix in bc5113007a
The assert that was removed in bc5113007a, was a result of error
handling in read_metadata_vorbiscomment_() which set obj->num_comments
to zero, without freeing obj->comments and setting it to NULL.

This commit also restores the assert that was removed.
2015-07-05 20:57:39 +10:00
Erik de Castro Lopo
bc5113007a libFLAC: Remove un-needed assert
This asset was firing when the build was configured with --enable-debug
and the flac executable was then run under American Fuzzy Lop. Removing
the assert did not cause any other problems, even under AFL.
2015-07-04 16:27:33 +10:00
Erik de Castro Lopo
48ff5ee89d replaygain: Remove dead assignment
Patch-from: lvqcl <lvqcl.mail@gmail.com>
2015-07-04 12:36:28 +10:00
Erik de Castro Lopo
b105f9ad93 libFLAC: Remove un-needed test for NULL before free
Passing a NULL pointer to free() is a no-op.
2015-07-04 12:36:28 +10:00
Erik de Castro Lopo
ccb5a4debd flac: Fix inlining failure warning
Also remove related, but old and irrelevant comment.
2015-07-04 11:51:33 +10:00
Erik de Castro Lopo
d9aa331ce4 grabbag: Replace strncpy with safe_strncpy
Patch-from: lvqcl <lvqcl.mail@gmail.com>
2015-07-04 09:15:27 +10:00
Erik de Castro Lopo
bc1f15db29 Remove old incorrect comment
As discussed on the flac-dev mailing list.

Patch-from: lvqcl <lvqcl.mail@gmail.com>
2015-04-25 08:16:34 +10:00
Tristan Matthews
a84587061c configure: Only use -mstackrealign on i686 for mingw32/os2
Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2015-04-19 06:27:20 +10:00
Erik de Castro Lopo
1ed65e5600 configure.ac : Add -mstackrealign whenever we add -msse2.
There have been some (pretty much unconfirmed) reports of problems
with SSE enabled but without this stack alignment flag.
2015-03-31 10:14:29 +11:00
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