Commit Graph

17 Commits

Author SHA1 Message Date
Desour dd1043c4c0 Replace non-leading tabs with spaces, using:
find -type f |  # list all regular files
  grep -E '\.(h|cpp|mm)$' |  # filter for source files
  grep -v '/mt_' |  # filter out generated files
  grep -v '/vendor/' | # and vendored GL
  xargs -n 1 -P $(nproc) ./replace_non_leading_tabs.lua  # reformat everything
2024-03-21 22:08:26 +01:00
numzero b01a3ea781 Fix ifs clang-format didn’t get 2024-03-21 22:08:26 +01:00
Desour f5c6d3e945 Reformat the code, using:
find -type f |  # list all regular files
  grep -E '\.(h|cpp|mm)$' |  # filter for source files
  grep -v '/mt_' |  # filter out generated files
  grep -v '/vendor/' | # and vendored GL
  grep -v '/test/image_loader_test.cpp' |  # and this file (has giant literals arrays)
  xargs -n 1 -P $(nproc) clang-format -i  # reformat everything

Co-authored-by: numzero <numzer0@yandex.ru>
2024-03-21 22:08:26 +01:00
Fatih Uzunoglu 0dab737d60 Do not use `core::max_()` with variable that can not be addressed
header struct is packed, and `core::max_()` takes the input as reference.
2024-02-12 16:31:10 +01:00
numzero 85081d6fe0 Fix off-by-one error in the TGA RLE decompressor 2023-11-01 14:40:11 +01:00
cutealien 4a7d3de89a Merging r6555 through r6560 from branch releases/1.8 to trunk
- Fixing buffer overflow in tga loader

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6561 dfc29bdd-3216-0410-991c-e03cc46cb475
2023-10-21 17:27:11 +02:00
cutealien 9813b460e1 Fix number overflows in TGA loader causing crashes
Image size calculation could overflow s32 in one place (but not others where it was done correct), which first lead to wrong amount of memory getting allocated for image data and later crash in the CColorConverter.
Thanks @sfan5 for his fuzzing tests @https://github.com/minetest/irrlicht/issues/236
and @erlehmann for passing them on: https://irrlicht.sourceforge.io/forum/viewtopic.php?t=52925
Also updating changes.txt with TGA loader changes from this and previous commits.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6535 dfc29bdd-3216-0410-991c-e03cc46cb475
2023-10-15 13:54:39 +02:00
cutealien 565f14677c Fix crash caused by memory overwriting in TGA loader caused by bad RLE data
From sfan5's fuzzing test reported in Minetest here: https://github.com/minetest/irrlicht/issues/236
Was missing test if it writes beyond allocated memory which can be triggered by TGA's which lie in their RLE data.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6534 dfc29bdd-3216-0410-991c-e03cc46cb475
2023-10-15 13:54:24 +02:00
cutealien f53af0f2cf TGA images with palettes in 24 or 32 bit now create 32 bit images
Was creating 16-bit images for those before.
Could also support 24-bit images, but either we need another convert function or another palette for that (the 16 and 32 bit both work with 32 bit palettes, the 24 bit conversion function only with 24 bit palettes)

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6533 dfc29bdd-3216-0410-991c-e03cc46cb475
2023-10-15 13:54:21 +02:00
cutealien 05ebc43222 Fix TGA's with bad palette colors reading from behind palette memory
TGA's can claim to use less palette colors than they later do.
We only support 8-bit palettes, so to make this safer lets just always allocate at least 256 bytes.
Thanks @erlehmann for report and testcase: https://irrlicht.sourceforge.io/forum/viewtopic.php?p=307191
Based on Minetest bug report: https://github.com/minetest/irrlicht/issues/236

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6532 dfc29bdd-3216-0410-991c-e03cc46cb475
2023-10-15 13:54:16 +02:00
Vitaliy 9954667c45
Cleanup line endings (#245)
The exact commands to make this commit were:

git reset --hard origin/master
find -type f |  # list all regular files
  grep -E '\.(h|cpp|fsh|vsh|mm)|LICENSE$' |  # filter for text files
  xargs -n 1 -P $(nproc) sed -i 's:\s*$::'  # for each file, trim trailing whitespace including the CR
git commit -a
2023-10-03 20:37:00 +02:00
cutealien 98df6eae77 Unify & improve log messages
Lots of places where coders did not realize our Printer::log with hint adds a ": " string between message and hint
Which caused uglier messages in a few places (added documentation for that, maybe helps?)
Some added info in a few places
Some whitespace unification
Some spelling unification

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6414 dfc29bdd-3216-0410-991c-e03cc46cb475
2023-03-24 17:09:11 +01:00
Vitaliy 5a5a7d04b7
Drop IrrCompileConfig (#163) 2023-03-11 15:04:09 +01:00
sfan5 dbd39120e7 Limit dimensions of all image loaders to 23000x23000 2021-10-05 11:17:36 +02:00
ROllerozxa ac57007c55
Readd TGA format support (#64) 2021-09-13 21:21:26 +02:00
hecks 4ab3de3bab
Delete lots of unused features (#48) 2021-07-23 16:23:44 +02:00
cutealien 2ae2a551a6 Merging r5975 through r6036 from trunk to ogl-es branch.
GLES drivers adapted, but only did make compile-tests.


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/branches/ogl-es@6038 dfc29bdd-3216-0410-991c-e03cc46cb475
2020-01-03 19:05:16 +00:00