Commit Graph

22 Commits

Author SHA1 Message Date
Mads Kiilerich
bc2e8bebe4 src/wavlike.c: Fix wavlike_subchunk_parse skipping of erroneous subchunks, closes #374
Drop invalid +4 as in 65eabcbf7.
2022-10-27 09:58:02 +05:00
Mads Kiilerich
cc5be43f09 tests/error_test.c: introduce wav_list_recover_test to cover #374
The test is currently been negated so it expects to hit the problem.
That will change when the problem is fixed.
2022-10-27 09:58:02 +05:00
evpobr
610c6392cb Fix deprecated function warning
The `GetVersionEx` function  has been deprecated.

Since it doesn't make much sense here, it has been deleted.
2021-02-17 13:44:15 +05:00
bobsayshilol
5ba69401c1
Fix pedantic warnings (#703)
* Fix warnings about incorrect format specifiers.
GCC only wants to see void pointers for %p formatters, so cast as appropriate.

* Fix a warning about an invalid enum value.
The following warning was observed when compiling with -pedantic:

    warning: ISO C restricts enumerator values to range of 'int' (2147483648 is too large)

The values of these enums don't escape wav_read_header() and are only used to set bits in a bitmask, so simply use the next bit rather than jumping to a huge number.

* Give anonymous unions a name.
This fixes the 'anonymous unions are a C11 extension' warning when compiling with -pedantic.

* Use flexible array members rather than zero sized arrays.
This flagged up the following warning when compiling with -pedantic:
    warning: zero size arrays are an extension [-Wzero-length-array]

* Safely return the smallest value of a short.
GCC gives the following warning when compiling with -pedantic:

    warning: overflow in conversion from 'int' to 'short int' changes value from '32768' to '-32768' [-Woverflow]

This looks intentional from the surrounding code, so return -32768 in a legal way rather than depending on undefined behaviour.

* Use the same min/max approach with all compilers.
The GCC specific code gives the following warning from GCC when compiled with -pedantic:

    warning: ISO C forbids braced-groups within expressions [-pedantic]

This code was also a fundamentally different way of calculating min/max since it didn't evaluate the inputs more than once, which meant there was potentially a difference in behaviour when the library was built with different compilers if the evaluation of 'a' or 'b' had side effects.
2021-02-14 10:16:33 +05:00
Erik de Castro Lopo
dc56b25f41 tests/error_test.c: Add unrecognised file test 2018-03-17 13:05:25 +11:00
evpobr
58737ceb48 tests: Fixes for MSVC
* src/test_main.c: Fix undeclared off_t type with MSVC
* tests/misc_test.c: Fix undefined S_ISCHR & S_ISBLK with MSVC
* tests/stdin_test.c: Fix undefined STDIN_FILENO with MSVC
* tests/win32_ordinal_test.c: Fix undeclared getcwd() with MSVC
* Fix missing unistd.h under Win32

Related: https://github.com/erikd/libsndfile/issues/154
2017-04-14 13:03:27 +10:00
Erik de Castro Lopo
8dc7478ee7 tests/error_test.c: Fix uninitialized value error
The `SF_INFO` struct was not initialized before being passed to
`sf_open`.

Closes: https://github.com/erikd/libsndfile/issues/209
2017-03-21 18:35:12 +11:00
Erik de Castro Lopo
18c1105981 Whitespace and cstyle fixes. 2012-01-20 22:46:13 +11:00
Erik de Castro Lopo
f209698448 Update copyright dates. 2011-01-19 21:36:56 +11:00
Erik de Castro Lopo
ea3e2a2bc9 tests/error_test.c : Don't terminate when sf_close() returns zero in error_close_test(). 2009-12-08 21:29:42 +11:00
Erik de Castro Lopo
a38e0b105e Update copyright notices. 2009-02-07 15:20:17 +11:00
Erik de Castro Lopo
5992144307 tests/error_test.c : Fix failure behaviour in error_number_test. 2008-10-26 20:19:25 +11:00
Erik de Castro Lopo
10ca1fd3d1 tests : Fix gcc-4.3 compiler warnings. 2008-10-19 16:06:42 +11:00
Erik de Castro Lopo
3b05211ace Make sf_close return an error is the file descriptor is already closed. Add a test. Thanks to Dave Flogeras for the but report. 2008-04-27 18:33:46 +10:00
Erik de Castro Lopo
82ee6c7901 Move tests from open_fail_test.c to error_test.c and remove the former. 2007-10-23 06:33:35 +10:00
Erik de Castro Lopo
8479935b4a error_test.c : Make the test distclean correct. 2005-12-29 03:34:20 +00:00
Erik de Castro Lopo
e582a8c893 A test to make sure sf_error() returns a valid error number. 2005-12-10 02:43:03 +00:00
Erik de Castro Lopo
f3ea80efe5 Fix autoconf config issues using new file sfconfig.h. 2005-09-03 06:12:30 +00:00
Erik de Castro Lopo
b27fdfb4d4 Add 2004 copyright dates. 2004-03-01 08:51:25 +00:00
Erik de Castro Lopo
26efcb703f More zip.com.au to mega-nerd.com changes. 2004-02-13 12:31:34 +00:00
Erik de Castro Lopo
a1e9265cad initial import
(automatically generated log message)
2004-01-21 07:46:34 +00:00
Erik de Castro Lopo
cb979e10a7 First snapshot of the public project. 2007-05-14 19:55:24 +10:00