Commit Graph

2828 Commits

Author SHA1 Message Date
Max Smolens
808fb07864 CMake: Fix Package Configuration file when ENABLE_EXTERNAL_LIBS is OFF
When libsndfile is configured with ENABLE_EXTERNAL_LIBS=OFF, the CMake
Package Configuration file shouldn't look for the external libraries.
Otherwise, the return() call in the find_dependency() macro causes
find_package(SndFile) to fail if the libraries are not found.

Furthermore, the find_dependency() calls are necessary only when
BUILD_SHARED_LIBS=OFF. In other scenarios, the external libraries aren't
linked by client projects.
2020-06-19 20:58:00 +10:00
evpobr
06ebde50e3 CMake fixes
* Update Vorbis targets to match upstream
* Better dependency handling with Vcpkg
* Fix dev warning with SQLite3
2020-04-12 16:20:04 +10:00
evpobr
a1fa15ff44 cmake: Bump version to 1.0.29pre2 2020-04-07 18:54:45 +10:00
Nicolas Imbard
e1afeec6e8 opus: Allow setting of OGG page latency
Latency is set via 'sf_command' using 'SFC_SET_OGG_PAGE_LATENCY_MS'.
Max average latency set at 1600ms, min average latency set at 50ms.
Default latency set at 1000ms.

Closes: https://github.com/erikd/libsndfile/pull/512
2020-04-05 20:07:01 +10:00
Arthur Taylor
65e13303ae sndfile-convert: Handle gsm, vox and opus extensions the same way
Closes: https://github.com/erikd/libsndfile/pull/498
2020-04-05 20:07:01 +10:00
Leland Lucius
bbe1975e1f Fix IMA-ADPCM encoding for AIFF files
Closes: https://github.com/erikd/libsndfile/pull/516
2020-04-05 20:07:01 +10:00
Dragos Oancea
49b7d619a8 src/ima_adpcm.c: Fix ASAN crash in wavlike_ima_seek()
ASAN says: "pc points to the zero page"

Closes: https://github.com/erikd/libsndfile/pull/507
2020-04-05 20:07:01 +10:00
Kevin Calhoun
7695e5b3f3 Wave64: Permit and skip arbitrary chunks prior to the data chunk
Closes: https://github.com/erikd/libsndfile/pull/509
2020-04-05 18:28:14 +10:00
evpobr
4bdd741460 azure-pipelines.yml: Add Opus dependency 2020-03-08 17:35:14 +11:00
evpobr
e6909192ce CMake improvements
* Fix Ogg and Opus imported targets
* Better SndFileConfig.cmake module with dependency checks
* Fix config-file package installation directory
* Prefer config-file package mode for Windows CI builds
* Update README.md
* Allow CMAKE_MSVC_RUNTIME_LIBRARY option to set MSVC ABI
* Fix some bugs in FindFLAC.cmake (closes #505)
2020-03-08 17:34:27 +11:00
Jean Pierre Cimalando
a7e9fb5f7c List pkgconfig dependencies in Requires.private 2020-03-08 13:02:42 +11:00
Henner Zeller
d397671809 Add libopus to the build-dependency requirements in READMEs. 2019-11-10 09:37:00 +11:00
evpobr
97a361afc2 README.md: Fix information about CMake builds
Closes #494.
2019-10-24 18:32:01 +11:00
Naji Mammeri
ae64caf9b5 Fix building programs while BUILD_SHARED_LIBS=ON 2019-10-13 08:54:20 +11:00
evpobr
be5a7ccee3 CMake: fix default install directory on Windows
Closes #486.
2019-09-17 06:21:32 +10:00
Moonbase59
3a57ea117b Add BWF v2 loudness parameters
Closes: https://github.com/erikd/libsndfile/issues/479
2019-08-27 07:28:25 +10:00
evpobr
22c2fa64c2 tests/command_test.c: Fix format specifiers
Closes: #472
2019-07-02 20:59:35 +10:00
Erik de Castro Lopo
6978654319 configure.ac: 1.0.29rc2 2019-06-13 19:19:10 +10:00
Martin Delille
2269af8417 Fix zero-as-null-pointer-constant-warning 2019-06-12 07:18:30 +10:00
Erik de Castro Lopo
25824cb914 sndfile-convert: Close input file on output format error 2019-04-22 02:48:50 +10:00
Erik de Castro Lopo
df55170ce4 sndfile-convert: Fix conversion to/from Opus 2019-04-22 02:48:50 +10:00
Erik de Castro Lopo
a3a4d7a089 opus: Fix issues found using fuzzing 2019-04-22 02:48:50 +10:00
David Seifert
d5531723a0 Ignore -Wformat-truncation warnings
* These are spurious and pollute logs unnecessarily.
2019-04-08 11:06:01 +10:00
Matti Lehtimäki
a6866b8716 CMake: Fix installation of man pages. 2019-03-29 11:31:26 +05:00
Erik de Castro Lopo
5056a77fda Scripts/static-deps-build.mk : Better fuzzing support
The git version of libogg has a `--disable-crc` configure option which is
useful/necessary when fuzz testing. However, disabling libogg CRC is highly
undesirable when not fuzz testing so both need to be supported.

Also add configure script option checking.
2019-03-08 17:57:37 +11:00
Emilio Pozuelo Monfort
6d7ce94c02 wav_write_header: don't read past the array end
If loop_count is bigger than the array, truncate it to the array
length (and not to 32k).

CVE-2019-3832
2019-03-07 16:47:46 +11:00
Erik de Castro Lopo
7c5da26b70 static-deps-build.mk: Add opus to build 2019-02-26 20:22:14 +11:00
Erik de Castro Lopo
238ee50429 programs/sndfile-convert.c: Add -opus option 2019-02-23 18:30:02 +11:00
Arthur Taylor
bc82928504 Vorbis: Clean up calculation of datalength 2019-02-22 17:59:53 +11:00
Arthur Taylor
ea87e01ca2 Vorbis: Use new ogg functions, add bisection seek support. 2019-02-22 17:59:53 +11:00
Arthur Taylor
326e4533f3 Opus file support
Ogg: Introduce new functions ogg_sync_fseek(), ogg_ftell(), ogg_next_page(),
ogg_stream_next_page(), ogg_sync_last_page_before(), and
ogg_stream_unpack_page(). Use ogg_sync_* for ogg_read_first_page(). Bump libogg
version requirement from 1.1.3 to 1.3.0 as LibOgg 1.3.0 is required for
ogg_stream_pageout_fill() and ogg_stream_flush_fill().

Opus: Add opus support. Document added commands
SFC_(GET|SET)_ORIGINAL_SAMPLERATE. Added or extended tests ogg_opus_test,
compression_size_test, floating_point_test, lossy_comp_test, string_test,
external_libs_test. Change Opus to non-experimental.
2019-02-20 19:30:30 +11:00
Erik de Castro Lopo
1a87c443fe Avoid two static analysis warnings
Neither of these issues was of any concern, but they have been fixed to
avoid the static analysis warnings.

Closes: https://github.com/erikd/libsndfile/issues/445
2019-02-07 16:56:01 +11:00
evpobr
300375ecb8 Integrate Azure Pipelines CI 2019-02-04 06:38:19 +11:00
evpobr
71661c4f19 CMake: Fix warnings on MinGW platform
Fixes warning: `"__USE_MINGW_ANSI_STDIO" redefined`.

`__USE_MINGW_ANSI_STDIO` is required to use 64-bit numbers in
    printf-like functions.
2019-02-01 07:45:29 +11:00
evpobr
578e470ffa src/file_io.c: Use modern WinAPI functions 2019-01-30 16:05:10 +11:00
evpobr
f30432f0ef src/wavlikie.h: Fix EXT_SUBFORMAT struct
According to MSDN all the GUID fields are unsigned.

Fixes -Woverflow warnings in pedantic mode.
2019-01-29 14:21:28 +11:00
evpobr
58c6458140 src/file_io.c: Use CreateFileA for ANSI path
With `_UNICODE`defined `CreateFile` is expanded to unicode `CreateFileW` instead of ANSI `CreateFileA`.

Thanks @aholzinger

Closes: #442
2019-01-10 19:37:21 +11:00
Marcel Waldvogel
c11deaa04e Do not require seek ops on non-seekable files 2019-01-03 15:23:11 +11:00
Marcel Waldvogel
c0dd8b4a4f Handle snprintf() format-truncation warnings 2019-01-03 15:21:05 +11:00
Erik de Castro Lopo
bef2abc9e8 tests/command_test.c: Fix ASAN test failure 2019-01-02 12:24:21 +11:00
Erik de Castro Lopo
d07d936a10 travis: Use Address Sanitizer when building in travis
Aim here is to make sure that PRs are ASAN clean.

Currently not able to get ASAN working with Clang, but it does work with GCC
so use that.
2019-01-02 12:24:21 +11:00
Erik de Castro Lopo
42132c5433 src/wav.c: Fix heap read overflow
This is CVE-2018-19758.

Closes: https://github.com/erikd/libsndfile/issues/435
2019-01-01 20:59:51 +11:00
Hugo Lefeuvre
8ddc442d53 a/ulaw: fix multiple buffer overflows (#432)
i2ulaw_array() and i2alaw_array() fail to handle ptr [count] = INT_MIN
properly, leading to buffer underflow. INT_MIN is a special value
since - INT_MIN cannot be represented as int.

In this case round - INT_MIN to INT_MAX and proceed as usual.

f2ulaw_array() and f2alaw_array() fail to handle ptr [count] = NaN
properly, leading to null pointer dereference.

In this case, arbitrarily set the buffer value to 0.

This commit fixes #429 (CVE-2018-19661 and CVE-2018-19662) and
fixes #344 (CVE-2017-17456 and CVE-2017-17457).
2018-12-24 16:43:48 +11:00
Erik de Castro Lopo
ba8a7577c6
Add support for more than 1000 cue points in WAV and AIFF files (#434)
This work was originally submitted by Diemo Schwarz <schwarz@ircam.fr> in
PR https://github.com/erikd/libsndfile/pull/197 which was rebased and
cleaned up.

Closes: https://github.com/erikd/libsndfile/pull/197
2018-12-23 20:32:56 +11:00
Erik de Castro Lopo
b4bd397ca7 Add Scripts/asan-configure.sh 2018-11-27 18:21:11 +11:00
Arthur Taylor
81a71e08c0 Fix lossy_comp_test sdlcomp_test_(float|double) for Vorbis (#426)
While experimenting, determined that Vobis' analysis stops working on
non-normalized floating point input outside the range of [2000.0, -2000.0], and
seems to get worse the larger the magnitude. As the sdlcomp_test_float and
sldcomp_test_double tests work with non-normalized floats with a magnitude of
32000.0, this explains why they do not work for Vorbis.

This patch fixes the test by reducing the magnitude of the test data at encode
and restoring it at decode if it detects Vorbis, mantaining the same 32000.0
overall magnitude so the envelope values for the test are the same as they are
for other tests and format.

It is unknown at this time if the input range magnitude of 2000.0 is  a
limitation of Vorbis or libvorbis.
2018-10-11 09:26:56 +11:00
evpobr
123cb9f9a5 tests/vrtual_io_test.c: Fix typo
Closes: https://github.com/erikd/libsndfile/issues/417
2018-09-20 07:13:50 +10:00
Brian Heim
2d658815e3 Improve sf_command documentation
* move SFC_SET_ADD_HEADER_PAD_CHUNK to deprecated section
* document SFC_GET/SET_CHANNEL_MAP_INFO
* docs: fix typo in command.html
* docs: fix typo in name of command

Closes:  https://github.com/erikd/libsndfile/pull/422
2018-09-18 11:18:16 +10:00
evpobr
83c0d85187 doc/command.html: Document SFC_GET_CURRENT_SF_INFO command
Closes #415
2018-09-16 09:19:10 +10:00
evpobr
1e4e839008
Update configure.ac
We use C99, so no we don't need -Wdeclaration-after-statement warning

Related to: #357
2018-09-14 09:29:38 +05:00