No description
Find a file
Sam Lantinga a9bcdb83a9 Fixed bug 1014 - SDL_ConvertAudio crashes
The patch Mark attached looks good and valgrind gives it a clean bill of health:

Mark.Howson@ntu.ac.uk 2010-12-15 07:45:25 PST

Reproducible here under Windows and Linux. Looking at the code for
SDL_Upsample_S16LSB_2c:

const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 2;
const Sint16 *target = ((const Sint16 *) cvt->buf) - 2;
while (dst > target) {
   dst[1] = ((Sint16) SDL_SwapLE16(sample1));
   dst[0] = ((Sint16) SDL_SwapLE16(sample0));
   dst -= 2;
...

if dstsize is odd (and therefore dst), it'll write to target[1] which is one
byte before the allocated buf.

The attached patch to sdlgenaudiocvt.pl changes dst > target to dst >= target,
and removes the - $channels for the upsample case. The patch is not fully
tested, but seems to work here.
2012-01-08 17:10:57 -05:00
acinclude
android-project Fixed bug 1293 - [Android] Support Pause/Resume 2012-01-08 01:05:25 -05:00
build-scripts No man pages for SDL 1.3 2011-11-23 13:25:45 -05:00
include Fixed bug 1242 - PATCH: Improve support for OpenGL ES under X11 2012-01-08 02:23:37 -05:00
src Fixed bug 1014 - SDL_ConvertAudio crashes 2012-01-08 17:10:57 -05:00
test Fixed bug 1242 - PATCH: Improve support for OpenGL ES under X11 2012-01-08 02:23:37 -05:00
VisualC Fixed bug 1287 - VS2010 project doesn't include the SDL_syscond.c file 2012-01-08 01:15:20 -05:00
Xcode Updated Xcode project 2012-01-08 14:45:57 -05:00
Xcode-iOS Fixed running on iPhone 3G 2012-01-07 22:20:15 -05:00
.DISABLED-hgeol
.hgignore Added more test programs to .hgignore 2011-08-23 06:28:28 -04:00
.hgtags
.indent.pro
aclocal.m4
Android.mk
autogen.sh SDL_revision.h is always updated as part of the build process now. 2011-02-28 09:06:15 -08:00
Borland.html
Borland.zip
BUGS
configure Fixed bug 1242 - PATCH: Improve support for OpenGL ES under X11 2012-01-08 02:23:37 -05:00
configure.in Fixed bug 1242 - PATCH: Improve support for OpenGL ES under X11 2012-01-08 02:23:37 -05:00
COPYING SDL 1.3 is now under the zlib license. 2011-04-08 13:03:26 -07:00
CREDITS
INSTALL
Makefile.ds Removed buggy and LGPL MMX mixing routines. 2011-04-08 13:16:33 -07:00
Makefile.in Updated iOS projects and renamed iPhoneOS to iOS 2012-01-05 21:41:55 -05:00
Makefile.minimal
Makefile.pandora Removed /dev/dsp DMA audio target. 2011-07-24 03:37:13 -07:00
Makefile.wiz Removed /dev/dsp DMA audio target. 2011-07-24 03:37:13 -07:00
NOTES
README Updated documentation to reflect new license 2011-04-15 14:22:08 -07:00
README-SDL.txt Updated documentation to reflect new license 2011-04-15 14:22:08 -07:00
README.android
README.BeOS
README.DirectFB
README.ds NDS update 2011-03-26 21:26:05 -07:00
README.gesture
README.HG
README.iOS Updated iOS projects and renamed iPhoneOS to iOS 2012-01-05 21:41:55 -05:00
README.MacOSX
README.pandora
README.Platforms SDL still supports older iPod Touch and first generation iPhones. 2011-02-21 11:04:27 -08:00
README.Porting
README.touch
README.Watcom
README.WinCE
sdl-config.in
sdl.m4
sdl.pc.in
SDL.spec.in Updated documentation to reflect new license 2011-04-15 14:22:08 -07:00
TODO
UNDER_CONSTRUCTION.txt
VisualC.html
Watcom-Win32.zip
WhatsNew

                         Simple DirectMedia Layer

                                  (SDL)

                                Version 1.3

---
http://www.libsdl.org/

This is the Simple DirectMedia Layer, a general API that provides low
level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL,
and 2D framebuffer across multiple platforms.

The current version supports Windows, Windows CE, Mac OS X, Linux, FreeBSD,
NetBSD, OpenBSD, BSD/OS, Solaris, iOS, and Android. The code contains
support for other operating systems but those are not officially supported.

SDL is written in C, but works with C++ natively, and has bindings to
several other languages, including Ada, C#, Eiffel, Erlang, Euphoria,
Go, Guile, Haskell, Java, Lisp, Lua, ML, Objective C, Pascal, Perl, PHP,
Pike, Pliant, Python, Ruby, and Smalltalk.

This library is distributed under the zlib license, which can be found
in the file "COPYING".

The best way to learn how to use SDL is to check out the header files in
the "include" subdirectory and the programs in the "test" subdirectory.
The header files and test programs are well commented and always up to date.
More documentation is available in HTML format in "docs/index.html", and
a documentation wiki is available online at:
	http://www.libsdl.org/cgi/docwiki.cgi

The test programs in the "test" subdirectory are in the public domain.

Frequently asked questions are answered online:
	http://www.libsdl.org/faq.php

If you need help with the library, or just want to discuss SDL related
issues, you can join the developers mailing list:
	http://www.libsdl.org/mailing-list.php

Enjoy!
	Sam Lantinga				(slouken@libsdl.org)