|
4fe7b2cb
|
2022-03-24T11:00:43
|
|
static analysis: Fixed several complaints from codechecker.
There are still some pending Objective-C specific issues.
Reference issue #4600.
|
|
120c76c8
|
2022-01-03T09:40:00
|
|
Updated copyright for 2022
|
|
2004aaf3
|
2021-11-22T16:54:17
|
|
SDL_wave: use SDL_free
|
|
3bf7994f
|
2021-09-27T14:38:12
|
|
Add and use `SDL_FALLTHROUGH` for fallthroughs
Case fallthrough warnings can be suppressed using the __fallthrough__
compiler attribute. Unfortunately, not all compilers have this
attribute, or even have __has_attribute to check if they have the
__fallthrough__ attribute. [[fallthrough]] is also available in C++17
and the next C2x, but not everyone uses C++17 or C2x.
So define the SDL_FALLTHROUGH macro to deal with those problems - if we
are using C++17 or C2x, it expands to [[fallthrough]]; else if the
compiler has __has_attribute and has the __fallthrough__ attribute, then
it expands to __attribute__((__fallthrough__)); else it expands to an
empty statement, with a /* fallthrough */ comment (it's a do {} while
(0) statement, because users of this macro need to use a semicolon,
because [[fallthrough]] and __attribute__((__fallthrough__)) require a
semicolon).
Clang before Clang 10 and GCC before GCC 7 have problems with using
__attribute__ as a sole statement and warn about a "declaration not
declaring anything", so fall back to using the /* fallthrough */ comment
if we are using those older compiler versions.
Applications using SDL are also free to use this macro (because it is
defined in begin_code.h).
All existing /* fallthrough */ comments have been replaced with this
macro. Some of them were unnecessary because they were the last case in
a switch; using SDL_FALLTHROUGH in those cases would result in a compile
error on compilers that support __fallthrough__, for having a
__attribute__((__fallthrough__)) statement that didn't immediately
precede a case label.
|
|
abc12a83
|
2021-11-11T15:58:44
|
|
Revert "Add and use `SDL_FALLTHROUGH` for fallthroughs"
This reverts commit 66a08aa3914a98667f212e79b4f0b9453203d656.
This causes problems with older compilers:
https://github.com/libsdl-org/SDL/pull/4791#issuecomment-966630997
|
|
66a08aa3
|
2021-09-27T14:38:12
|
|
Add and use `SDL_FALLTHROUGH` for fallthroughs
Case fallthrough warnings can be suppressed using the __fallthrough__
compiler attribute. Unfortunately, not all compilers have this
attribute, or even have __has_attribute to check if they have the
__fallthrough__ attribute. [[fallthrough]] is also available in C++17
and the next C2x, but not everyone uses C++17 or C2x.
So define the SDL_FALLTHROUGH macro to deal with those problems - if we
are using C++17 or C2x, it expands to [[fallthrough]]; else if the
compiler has __has_attribute and has the __fallthrough__ attribute, then
it expands to __attribute__((__fallthrough__)); else it expands to an
empty statement, with a /* fallthrough */ comment (it's a do {} while
(0) statement, because users of this macro need to use a semicolon,
because [[fallthrough]] and __attribute__((__fallthrough__)) require a
semicolon).
Applications using SDL are also free to use this macro (because it is
defined in begin_code.h).
All existing /* fallthrough */ comments have been replaced with this
macro. Some of them were unnecessary because they were the last case in
a switch; using SDL_FALLTHROUGH in those cases would result in a compile
error on compilers that support __fallthrough__, for having a
__attribute__((__fallthrough__)) statement that didn't immediately
precede a case label.
|
|
f443a6fc
|
2021-02-11T02:05:02
|
|
Fix format string warnings for width-based integers
The DJGPP compiler emits many warnings for conflicts between print
format specifiers and argument types. To fix the warnings, I added
`SDL_PRIx32` macros for use with `Sint32` and `Uint32` types. The macros
alias those found in <inttypes.h> or fallback to a reasonable default.
As an alternative, print arguments could be cast to plain old integers.
I opted slightly for the current solution as it felt more technically correct,
despite making the format strings more verbose.
|
|
9130f7c3
|
2021-01-02T10:25:38
|
|
Updated copyright for 2021
|
|
53b16679
|
2020-11-11T12:33:55
|
|
SIZE_MAX need not be defined in limits.h
it can be in limits.h (windows) or stdint.h.
|
|
003a1698
|
2020-10-06T11:07:50
|
|
wav: Make sure the data size is a multiple of blockalign, not an exact match.
I _think_ this is a right thing to do; it fixes a .wav file I have here that
has blockalign==2 when channels==2 and bitspersample==16, which otherwise
would fail.
|
|
b6afbe63
|
2020-04-07T09:38:57
|
|
Added SDL_log.h to SDL_internal.h so logging is available everywhere
|
|
b1c6e7c2
|
2020-01-23T00:32:34
|
|
Fixed compile warning
|
|
dbe5c14b
|
2020-01-21T15:49:37
|
|
audio: Calculate a legitimate SDL_AudioSpec::silence in SDL_LoadWAV_RW().
|
|
a8780c6a
|
2020-01-16T20:49:25
|
|
Updated copyright date for 2020
|
|
ed469fa5
|
2019-10-23T09:36:41
|
|
Fixed bug 4842 - Redundant condition in MS_ADPCM_Decode and IMA_ADPCM_Decode
(Thanks!)
|
|
4953e050
|
2019-07-31T05:11:40
|
|
use SDL_zeroa at more places where the argument is an array.
|
|
7a47c292
|
2019-07-31T01:22:02
|
|
Fix bug 4746 - introduce SDL_zeroa macro.
|
|
fdc67c3c
|
2019-07-31T00:10:00
|
|
MS_ADPCM_Decode: fix assigning an array to a pointer (lose '&').
|
|
90e2dc98
|
2019-06-14T18:23:51
|
|
A few minor changes to placate static analysis.
|
|
2fa33d6f
|
2019-06-12T15:43:08
|
|
wave: Fixed static analysis warning about dead assignment.
(technically, this function never returns an error at this point, but since
it _does_ have an "uhoh, is this corrupt data?" comment that it ignores, we
should probably make sure we handle error cases in the future. :) )
|
|
cd011bb1
|
2019-06-12T10:42:02
|
|
SDL_Wave: missing field 'length' initializer
|
|
254eb677
|
2019-06-11T02:08:31
|
|
windows: Don't let Visual Studio insert an implicit dependency on memset().
Fixes Bugzilla #4662.
|
|
d8da33c0
|
2019-06-10T08:49:26
|
|
Fixed bug 4662 - SDL failed to build due to error LNK2019: unresolved external symbol _memset referenced in function _IMA_ADPCM_Decode with MSVC on Windows
LinGao
We build SDL with Visual studio 2017 compiler on Windows Server 2016, but it failed to build due to error LNK2019: unresolved external symbol _memset referenced in function _IMA_ADPCM_Decode on latest default branch. And we found that it can be first reproduced on ca7283111ad0 changeset. Could you please help have a look about this issue? Thanks in advance!
|
|
762b788f
|
2019-06-09T12:46:10
|
|
Cleanup on bug 3894 - Fuzzing crashes for SDL_LoadWAV
Simon Hug
Attached is a minor cleanup patch. It changes the option name of one hint to something better, puts one or two more checks in, and adds explicit casting where warnings could appear otherwise.
I hope the naming of the hints and their options is acceptable. It would be kind of awkward to change them after they get released with an official SDL version.
|
|
a21b5b30
|
2019-06-08T19:09:43
|
|
Fixed build
|
|
990e166a
|
2019-06-08T19:02:42
|
|
Fixed bug 3894 - Fuzzing crashes for SDL_LoadWAV
Simon Hug
I had a look at this and made some additions to SDL_wave.c.
The attached patch adds many checks and error messages. For some reason I also added A-law and ?-law decoders. Forgot exactly why... but hey, they're small.
The WAVE format is seriously underspecified (at least by the documents that are publicly available on the internet) and it's a shame Microsoft never put something better out there. The language used in them is so loose at times, it's not surprising the encoders and decoders behave very differently. The Windows Media Player doesn't even support MS ADPCM correctly.
The patch also adds some hints to make the decoder more strict at the cost of compatibility with weird WAVE files.
I still think it needs a bit of cleaning up (Not happy with the MultiplySize function. Don't like the name and other SDL code may want to use something like this too.) and some duplicated code may be folded together. It does work in this state and I have thrown all kinds of WAVE files at it. The AFL files also pass with it and some even play (obviously just noise). Crafty little fuzzer.
Any critique would be welcome. I have a fork of SDL with a audio-loadwav branch over here if someone wants to use the commenting feature of Bitbucket:
https://bitbucket.org/ChliHug/SDL
I also cobbled some Lua scripts together to create WAVE test files:
https://bitbucket.org/ChliHug/gendat
|
|
3f19a6d5
|
2019-06-08T18:07:58
|
|
CVE-2019-7578: Fix a buffer overread in InitIMA_ADPCM
If IMA ADPCM format chunk was too short, InitIMA_ADPCM() parsing it
could read past the end of chunk data. This patch fixes it.
CVE-2019-7578
https://bugzilla.libsdl.org/show_bug.cgi?id=4494
Signed-off-by: Petr P?sa? <ppisar@redhat.com>
|
|
5e13087b
|
2019-01-04T22:01:14
|
|
Updated copyright for 2019
|
|
e3cc5b2c
|
2018-01-03T10:03:25
|
|
Updated copyright for 2018
|
|
ca15c7d6
|
2017-09-07T10:56:08
|
|
wave: SDL_LoadWAV now supports 24-bit audio.
|
|
e8677a1b
|
2017-02-17T02:25:37
|
|
audio: Added basic WAVE_FORMAT_EXTENSIBLE support to .wav loader.
This is just enough to get you through a file that just used the extended
header for float or int data. It doesn't handle all the other things that
you expect from this header, like 24-bit samples inside a 32-bit container
or speaker masks.
|
|
45b774e3
|
2017-01-01T18:33:28
|
|
Updated copyright for 2017
|
|
761a7978
|
2016-08-05T01:59:06
|
|
audio: changed some SDL_memset() calls to SDL_zero(), other minor corrections.
|
|
42065e78
|
2016-01-02T10:10:34
|
|
Updated copyright to 2016
|
|
0e45984f
|
2015-06-21T17:33:46
|
|
Fixed crash if initialization of EGL failed but was tried again later.
The internal function SDL_EGL_LoadLibrary() did not delete and remove a mostly
uninitialized data structure if loading the library first failed. A later try to
use EGL then skipped initialization and assumed it was previously successful
because the data structure now already existed. This led to at least one crash
in the internal function SDL_EGL_ChooseConfig() because a NULL pointer was
dereferenced to make a call to eglBindAPI().
|
|
2c4a6ea0
|
2015-05-26T06:27:46
|
|
Updated the copyright year to 2015
|
|
b72938c8
|
2015-04-20T12:22:44
|
|
Windows: Always set the system timer resolution to 1ms by default.
An existing hint lets apps that don't need the timer resolution changed avoid
this, to save battery, etc, but this fixes several problems in timing, audio
callbacks not firing fast enough, etc.
Fixes Bugzilla #2944.
|
|
fe6c797c
|
2015-04-10T23:30:31
|
|
Fixed an iOS view orientation issue when SDL_GL_CreateContext or SDL_CreateRenderer is called.
|
|
b88ca1b4
|
2015-02-10T16:28:56
|
|
the last parameter of XChangeProperty is the number of elements.. and when the element format is 32.. the element is "long" so we have 5 long elements here.
Yes this seems confusing as on mac+linux Long is either 32 or 64bits depending on the architecture, but this is how the X11 protocol is defined. Thus 5 is the correct value for the nelts here. Not 5 or 10 depending on the architecture.
More info on the confusion https://bugs.freedesktop.org/show_bug.cgi?id=16802
|
|
b48e54aa
|
2015-01-26T22:00:29
|
|
Fixed bug 2802 - [patch] Fix android build compiling in wrong filesystem implementation
Jonas Kulla
The configure script didn't differentiate between Linux and Android, unconditionally compiling in the unix implementation of SDL_sysfilesystem.c.
I'm probably one of the very few people building SDL for android using classic configure + standalone toolchain, so this has gone undetected all along.
|
|
70438be2
|
2014-12-03T10:55:23
|
|
WinRT: fixed bug whereby SDL would override an app's default orientation
WinRT apps can set a default, preferred orientation via a .appxmanifest file.
SDL was overriding this on app startup, and making the app use all possible
orientations (landscape and portrait).
Thanks to Eric Wing for the heads up on this!
|
|
9c398852
|
2014-11-22T22:20:40
|
|
Corrected header file documentation comment.
|
|
24c86b55
|
2014-09-11T19:24:42
|
|
[X11] Reconcile logical keyboard state with physical state on FocusIn
since the window system doesn't do it for us like other platforms.
This prevents sticky keys and missed keys when going in and out
of focus, for example Alt would appear to stick if switching away
from an SDL app with Alt-Tab and had to be pressed again.
CR: Sam
|
|
19d878d7
|
2014-07-08T00:42:14
|
|
Skip JUNK chunks in wave files
|
|
73cb234b
|
2014-07-07T10:38:10
|
|
Fixed compiler warning on Mac OS X
|
|
1ee96bb9
|
2014-07-07T10:26:28
|
|
Fixed mingw64 build and warnings
|
|
9f5e3ed7
|
2014-06-22T10:05:59
|
|
Fixed bug 1673 - BEXT wave files only have extra metadata that you can easily skip through
bill
In SDL_wave.c, BEXT wave files with "bext" instead of "fmt " are choked on
if (chunk.magic != FMT) {
SDL_SetError("Complex WAVE files not supported");
was_error = 1;
goto done;
}
BEXT files http://en.wikipedia.org/wiki/Broadcast_Wave_Format actually playback the same as regular waves. All they have is (A LOT OF) extra header info.
To open them, just SKIP the "bext" chunk, and the "fmt " chunk will be a couple of hundred bytes later.
The "fmt " chunk is also bloated, but if you skip past the extra information to the "data" chunk, there is nothing different about a BEXT wave file than a "normal" one.
You can then load the data and proceed as normal.
|
|
7e52722d
|
2014-06-20T11:10:16
|
|
Fix compiler warnings in Native Client and Linux builds.
|
|
1f716769
|
2014-06-05T15:29:23
|
|
Fix warnings, only major one being an SDL_SetError not providing enough arguments.
|
|
da6d9a9f
|
2014-06-04T10:56:56
|
|
Added annotations to help code analysis tools
CR: Bruce Dawson
|
|
3dcb451f
|
2014-04-09T21:29:19
|
|
Added a README file regarding WinRT support
To note, this file is currently formatted with CRLF line endings, rather than
LF, to allow the file to be viewed with Notepad.
|
|
58edac3e
|
2014-02-02T00:53:27
|
|
Fixed bug 2374 - Update copyright for 2014...
Is it that time already??
|
|
f848adff
|
2013-11-29T10:06:08
|
|
Improve Android pause/resume behavior.
|
|
7e1289af
|
2013-11-24T23:56:17
|
|
Make internal SDL sources include SDL_internal.h instead of SDL_config.h
The new header will include SDL_config.h, but allows for other global stuff.
|
|
f79fc33a
|
2013-08-29T08:29:21
|
|
Christoph Mallon: Remove pointless if (x) before SDL_free(x)
|
|
1e49b1ed
|
2013-08-21T09:47:10
|
|
OCD fixes: Adds a space after /* (glory to regular expressions!)
|
|
695344d1
|
2013-08-21T09:43:09
|
|
OCD fixes: Adds a space before */
|
|
dad42067
|
2013-08-12T11:13:50
|
|
Fixes #2022, do not resume on Android when surfaceChanged
If the app is in landscape mode and the user presses the power button, a pause
is followed immediately by a surfaceChanged event because the lock screen
is shown in portrait mode. This triggers a "false" resume.
So, we just pause and resume following the onWindowFocusChanged events.
Also, wait for SDL_APP_WILLENTERBACKGROUND and SDL_APP_DIDENTERBACKGROUND before
blocking the event pump.
|
|
1ad936eb
|
2013-08-11T19:56:43
|
|
Fixed bug 2027 - Full-screen appears to be broken - hang in SDL_DestroyWindow()
Rainer Deyke
I'm running Linux Mint 15 with the Cinnamon window manager. SDL_DestroyWindow consistently locks up for me when the window if fullscreen.
|