Commit Graph

2762 Commits

Author SHA1 Message Date
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
evpobr
d2ca7f4afc README.md: cleanup and explain more about CMake 2018-09-03 12:37:11 +10:00
Brett T. Warden
aaea680337 Check MAX_CHANNELS in sndfile-deinterleave
Allocated buffer has space for only 16 channels. Verify that input file
meets this limit.

Fixes #397
2018-08-29 08:20:56 +10:00
Erik de Castro Lopo
73084e36be Remove octave-workspace 2018-08-26 14:55:23 +10:00
Conrad Jones
02467cc1bb modernize cmake module include. 2018-08-26 14:55:15 +10:00
evpobr
cebfdf275e Enable ENABLE_COMPATIBLE_LIBSNDFILE_NAME by default
Also fix bug from previous commit.
2018-08-25 12:16:36 +10:00
evpobr
61c416219c Add ENABLE_COMPATIBLE_LIBSNDFILE_NAME option 2018-08-25 12:16:36 +10:00
evpobr
6710ff3fc6 CMake: updates & fixes 2018-08-25 12:16:36 +10:00
evpobr
b0453860db .travis.yml: upgrade to Xenial image
We require pkg-config >= 0.27.

Closes #402
2018-08-10 16:49:23 +10:00
Michael Panzlaff
7ea3f9d874 src/wav.c: Fix WAV Sampler Chunk tune parsing
Fix parsing of instrument fine tuning instrument field. There is still
a possible rounding error involved which might require further
investigation at some stage.

Update the test as well.
2018-04-29 12:13:42 +10:00
David Seifert
4ab74d919f Fix out-of-tree building 2018-04-21 09:23:25 +10:00
David Seifert
f6818f39d7 More portable Make constructs in Makefile.am 2018-04-21 09:23:25 +10:00
Erik de Castro Lopo
fda9c8df2f sfendian.h: Fix fallback case for endwapping 2018-03-25 11:55:02 +11:00
David Seifert
818ad38a7f Makefile.am: Use more portable suffix rules
Closes: https://github.com/erikd/libsndfile/issues/369
Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2018-03-25 11:55:02 +11:00
Arthur Taylor
4e294e4603 Introduce ogg_read_first_page () to avoid seeks on open.
Reduce some code duplication of reading the first page of an Ogg bitstream while
also removing the need to re-read the beginning of a file when opening. Fixes
the issue of being unable to read Ogg bitstreams (a container designed for
streaming) from a pipe.
2018-03-20 19:35:47 +11:00
evpobr
1eb2a00199 CMake: fix BUILD_TESTING option
Closes: #376
2018-03-18 09:51:19 +11:00
evpobr
e62e5cd9f2 CMake: fix linking winmm.lib under MXE platform
Closes: #377
2018-03-18 09:50:57 +11:00