Commit Graph

31 Commits

Author SHA1 Message Date
Jan Engelhardt
1da600caf2 Resolve alloc-dealloc-mismatch in OutrageMusicSeq::FreeList
Once a level is loaded/started, the program runs into:

==17675==ERROR: AddressSanitizer: alloc-dealloc-mismatch (operator new vs operator delete []) on 0x50800031be20
    f0 operator delete[](void*) (/lib64/libasan.so.8+0xfde68) (BuildId: 5615a04b8d0a5a8eafa661f7235e2d98fa2b9137)
    f1 OutrageMusicSeq::FreeList() $GIT/music/sequencer.cpp:675
    f2 OutrageMusicSeq::Shutdown() $GIT/music/sequencer.cpp:208
    f3 D3MusicStop() $GIT/Descent3/d3music.cpp:118
    f4 mmInterface::OnDestroy() $GIT/Descent3/mmItem.cpp:400
    f5 UIWindow::Destroy() $GIT/ui/UIWindow.cpp:203
    f6 MainMenu() $GIT/Descent3/menu.cpp:911
    f7 MainLoop() $GIT/Descent3/descent.cpp:546
    f8 Descent3() $GIT/Descent3/descent.cpp:508
    f9 oeD3LnxApp::run() $GIT/Descent3/sdlmain.cpp:151

0x50800031be20 is located 0 bytes inside of 88-byte region [0x50800031be20,0x50800031be78)
allocated by thread T0 here:
    f0 operator new(unsigned long) (/lib64/libasan.so.8+0xfd2f8) (BuildId: 5615a04b8d0a5a8eafa661f7235e2d98fa2b9137)
    f1 OutrageMusicSeq::AddToList(short, short, int, OutrageMusicSeq::music_ins const*) $GIT/music/sequencer.cpp:653
    f2 OutrageMusicSeq::LoadTheme(char const*) $GIT/music/omflex.cpp:310
    f3 OutrageMusicSeq::Init(char const*) $GIT/music/sequencer.cpp:198
    f4 D3MusicStart(char const*) $GIT/Descent3/d3music.cpp:80
    f5 mmInterface::Create() $GIT/Descent3/mmItem.cpp:353
    f6 MainMenu() $GIT/Descent3/menu.cpp:732
    f7 MainLoop() $GIT/Descent3/descent.cpp:546
    f8 Descent3() $GIT/Descent3/descent.cpp:508
    f9 oeD3LnxApp::run() $GIT/Descent3/sdlmain.cpp:151
2024-08-30 01:26:00 +02:00
Thomas Roß
7b71873a69 [Cleanup] Removed function declarations that are not implemented. 2024-08-20 20:03:02 +02:00
Louis Gombert
60c5dbf1fe CMake: add all headers to target sources
This can help with CMake IDE integration and file indexing.
2024-08-09 17:09:14 +02:00
Azamat H. Hackimov
dd32f4e3ed Split libacm files to third_party/libacm and AudioEncode
Logically adecode/aencode belongs to AudioEncode.
2024-07-28 21:51:35 +03:00
Azamat H. Hackimov
220108f650 Isolate libacm module
Update libacm module, minor cleanups.
2024-07-28 16:50:43 +03:00
Azamat H. Hackimov
59487976f6 Isolate misc module
Isolate misc module for better dependency handling.
2024-06-27 01:26:35 +03:00
Azamat H. Hackimov
db8aa64d2f Make mem module isolated from project
Properly define MEM_USE_RTL definition only for mem library. Link other dependant modules with mem.
2024-06-20 00:43:51 +03:00
GravisZro
9cf9781369 Properly format/use variadic macros 2024-05-24 20:57:17 -04:00
Azamat H. Hackimov
a0929aefe2 Rename ddio_common to ddio 2024-05-24 22:18:14 +03:00
Azamat H. Hackimov
01c43cc0b4 ddio_common: cleanup headers 2024-05-24 22:18:12 +03:00
Azamat H. Hackimov
6bc3c71a83 Reordering ddio_common module
Merge ddio_lnx and ddio_win into ddio_common module.
2024-05-24 22:17:44 +03:00
GravisZro
5e5e0c99c3 Replace "short" with "int16_t" and fix missing headers 2024-05-23 23:49:31 -04:00
GravisZro
26b7776f43 Replace "ubyte" with "uint8_t" 2024-05-23 23:07:26 -04:00
Azamat H. Hackimov
3bd07d1f7e Reordering dependant on sndlib modules
Properly include and reuse produced static lib in other components.
2024-05-22 22:03:46 +03:00
JeodC
a4ab78192c Join license header with historical commentrs
Join the license header with historical comments using a separator so IDEs can correctly parse the initial header.

Also use .gitattributes to ensure all files are LF.
2024-05-08 14:41:19 -04:00
C.W. Betts
c6da74b069
Mark functions and variables as static (#185)
* Begin by marking functions and variables as static when needed.

* More work.

* More work.

* More pokes.

* More work.

* More work.

* Initial work on the netgames.

* Revert changes to the license header on source files.

* clutter.cpp poke.

* One final poke.

* Move some declarations to headers:

Move paged_in_count and paged_in_num to gamesequence.h
Move DoneLightInstance and StartLightInstance to polymodel.h

* Look over the AI script/plug-ins.

* Going over the changes one last time.

* Fix rebase errors.

* More migration from bare statics to static inlines.
2024-05-07 23:35:28 +02:00
Azamat H. Hackimov
4826c37a69 Add BUILD_INTERFACE to cfile module
Other modules that depends on it, can reuse includes on linking.
There some files formally not belonging any packages (lib directory), as workaround there temporary include_directories(cfile) on root of project. After migrating all modules this can be removed.
2024-04-24 00:41:02 +03:00
Azamat H. Hackimov
c275d359c7 Reapply "Cfile module update"
This reverts commit 066b436fd9.
2024-04-24 00:40:39 +03:00
Louis Gombert
43af644827 Fix -Wparentheses 2024-04-21 20:24:31 +02:00
Thomas Otto
00389c50ea Some more CMake white space formatting
- tabs to spaces
 - use Unix line endings everywhere
 - newline at end of file
 - remove trailing white space
 - no space between keywords and opening parenthesis
 - use 2 spaces to indent
2024-04-21 11:46:32 +02:00
Kevin Bentley
1f45163248 Updated source to reflect the license that this code is released under. 2024-04-20 09:57:49 -06:00
Louis Gombert
c2b71b8147 Standardize CMake formatting
lowercase function names, blocks indent
2024-04-20 14:45:49 +02:00
C.W. Betts
7d7f5bf896 Quiet Clang Static Analyzer warnings.
Most of the warnings were caused by uninitialized values. Some were in plug-ins that didn't have a break in a switch, causing the memory to be deleted twice.
2024-04-19 17:42:17 -06:00
Jeod
1fb980d2b1
Merge pull request #87 from Arcnor/msvc-warnings
enable stricter MSVC warnings, fix some of them
2024-04-19 12:15:03 -04:00
Edu Garcia
066b436fd9
Revert "Cfile module update" 2024-04-19 13:57:55 +01:00
Edu Garcia
6e772ca4da enable stricter MSVC warnings, fix some of them 2024-04-19 12:38:44 +01:00
Azamat H. Hackimov
9b45091633 Rename/move cfile related files
Rename to lowercase and move headers to own directory.
2024-04-19 00:17:15 +03:00
Azamat H. Hackimov
38128ea134 Additional clang-format 2024-04-17 00:25:04 +03:00
Kevin Bentley
7399b5a2f2 Fix CRLF line endings. 2024-04-16 14:21:35 -06:00
Kevin Bentley
c6640cc631 clang-format on everything. 2024-04-16 12:56:40 -06:00
Kevin Bentley
df209742fc Initial import 2024-04-15 21:43:29 -06:00