Commit Graph
19 Commits
Author SHA1 Message Date
Coen Rampen 4375d7edc5 AUDIO: Fix VOC infinite loop
This fixes a possible infinite loop in VocStream. It depends on the stream size
matching the size specified in the VOC block headers, but if the size in the
headers is incorrect and larger than the stream size, it will keep trying to
read the stream. This is fixed by adding an end-of-stream check to the error
check.
2022-06-18 14:13:32 +02:00
Coen Rampen 79c778c6c9 AUDIO: Enable subclassing of VocStream 2022-06-18 14:13:32 +02:00
Eugene Sandulenko abea37c9bb ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01:00
Orgad Shaneh 2bd0347968 AUDIO: Use override
Using clang-tidy modernize-use-override
2021-11-14 20:14:11 +02:00
Orgad Shaneh af529f568b AUDIO: Use nullptr
Using clang-tidy modernize-use-nullptr
2021-11-14 13:41:02 +02:00
Johannes Schickel 452cec49d9 AUDIO: Make GPL headers consistent in themselves. 2014-02-18 02:39:32 +01:00
D G Turner ac4087856f ALL: Remove optimization unstable code on checking for null after new.
These issues were identified by the STACK tool.

By default, the C++ new operator will throw an exception on allocation
failure, rather than returning a null pointer.

The result is that testing the returned pointer for null is redundant
and _may_ be removed by the compiler. This is thus optimization
unstable and may result in incorrect behaviour at runtime.

However, we do not use exceptions as they are not supported by all
compilers and may be disabled.

To make this stable without removing the null check, you could qualify
the new operator call with std::nothrow to indicate that this should
return a null, rather than throwing an exception.

However, using (std::nothrow) was not desirable due to the Symbian
toolchain lacking a <new> header.
A global solution to this was also not easy by redefining "new" as "new
(std::nothrow)" due to custom constructors in NDS toolchain and various
common classes.

Also, this would then need explicit checks for OOM adding to all new
usages as per C malloc which is untidy.

For now to remove this optimisation unstable code is best as it is
likely to not be present anyway, and OOM will cause a system library
exception instead, even without exceptions enabled in the application
code.
2014-01-15 02:36:19 +00:00
Johannes Schickel 9c14f4419b AUDIO: Make VOC decoder a bit more failsafe by still playing parts of invalid VOC files.
Formerly when an unsupported block was found the opening would fail. Instead
now all the valid blocks till that occasion will be played.

This fixes an missing sound in Full Throttle (thanks to clone2727 for
reporting), which is using a VOC file which fails to specify the proper block
length for its sound block.
2012-06-11 20:37:04 +02:00
Johannes Schickel 86a4bbbd9b AUDIO: Add more warnings in case invalid VOC data is encountered. 2012-01-26 02:43:58 +01:00
Johannes Schickel d620dd90bd AUDIO: Fix missing sounds in Simon 1 Amiga CD32.
It seems the VOC files used by Simon 1 Amiga CD32 use 128 as terminator block.
Added this as a special case with a debug output when it's caught.
2012-01-26 02:36:51 +01:00
Johannes Schickel c6599ea5ee AUDIO: Remove obsolete loadVOCFromStream. 2011-12-24 18:23:47 +01:00
Johannes Schickel dd42278373 AUDIO: Fix type 9 sound blocks in VOC code.
This should fix missing sound in Touche.
2011-11-24 22:55:25 +01:00
Johannes Schickel 9fa9f68789 AUDIO: Implement a basic VocStream class.
Now all VOCs are streamed rather than preloaded. This deprecates the
STREAM_AUDIO_FROM_DISK define, which was previously used to stream VOCs from
disk.

This might very well break some engines which relied on the stream not being
changed after makeVOCStream! I adapted all engines which had a check for
STREAM_AUDIO_FROM_DISK in their code.

It would be wise to check all other engines using VOC to see if this might
cause any problems for them.
2011-11-06 13:30:34 +01:00
Johannes Schickel d4f54a2c97 AUDIO: Strip out some unused VOC code. 2011-10-09 21:24:00 +02:00
Johannes Schickel 221434a83f AUDIO: Remove unused makeVOCStream interface. 2011-10-09 21:23:29 +02:00
Julien 2f200ac493 ANALYSIS: Fix potential memory leak when using realloc
When reallocation is unsuccessful, the passed buffer is not freed. In this case, assigning the result (NULL) will result in a leak of the original memory buffer.
See http://msdn.microsoft.com/en-us/library/kkedhy7c.aspx
2011-06-23 15:11:36 +08:00
strangerke 69b1485a22 GIT: Clean up: Suppress SVN tags, now useless 2011-05-12 01:16:22 +02:00
Ori Avtalion 9414d7a6e2 JANITORIAL: Reduce header dependencies in shared code
Some backends may break as I only compiled SDL
2011-04-28 15:08:58 +03:00
Max Horn 42ab839dd6 AUDIO: Rename sound/ dir to audio/
svn-id: r55850
2011-02-09 01:09:01 +00:00