Skip to content

Commit 4039776

Browse files
committed
Updated stb_image to 2.30 (src)
1 parent 30f2cbe commit 4039776

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Nuparu currently consists of:
1414
* [jsoncpp](https://github.com/open-source-parsers/jsoncpp) 1.9.6 (Mac/Win/Linux)
1515
* [Imath](https://github.com/AcademySoftwareFoundation/Imath) 3.1.12 (Mac/Win/Linux)
1616
* [OpenEXR](https://github.com/AcademySoftwareFoundation/openexr) 3.3.4 (Mac/Win/Linux)
17-
* [stb_image](https://github.com/nothings/stb) 2.29 (Src)
17+
* [stb_image](https://github.com/nothings/stb) 2.30 (Src)
1818
* [Ptex](http://ptex.us) 2.4.3 (Mac/Win/Linux)
1919
* [Partio](https://www.disneyanimation.com/technology/partio.html) 1.19.0 (Mac/Win/Linux)
2020
* [RMSD](http://boscoh.com/code/) (Src)

include/stb_image/stb_image.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* stb_image - v2.29 - public domain image loader - http://nothings.org/stb
1+
/* stb_image - v2.30 - public domain image loader - http://nothings.org/stb
22
no warranty implied; use at your own risk
33
44
Do this:
@@ -48,6 +48,7 @@ LICENSE
4848
4949
RECENT REVISION HISTORY:
5050
51+
2.30 (2024-05-31) avoid erroneous gcc warning
5152
2.29 (2023-05-xx) optimizations
5253
2.28 (2023-01-29) many error fixes, security errors, just tons of stuff
5354
2.27 (2021-07-11) document stbi_info better, 16-bit PNM support, bug fixes
@@ -5159,9 +5160,11 @@ static int stbi__parse_png_file(stbi__png *z, int scan, int req_comp)
51595160
// non-paletted with tRNS = constant alpha. if header-scanning, we can stop now.
51605161
if (scan == STBI__SCAN_header) { ++s->img_n; return 1; }
51615162
if (z->depth == 16) {
5162-
for (k = 0; k < s->img_n; ++k) tc16[k] = (stbi__uint16)stbi__get16be(s); // copy the values as-is
5163+
for (k = 0; k < s->img_n && k < 3; ++k) // extra loop test to suppress false GCC warning
5164+
tc16[k] = (stbi__uint16)stbi__get16be(s); // copy the values as-is
51635165
} else {
5164-
for (k = 0; k < s->img_n; ++k) tc[k] = (stbi_uc)(stbi__get16be(s) & 255) * stbi__depth_scale_table[z->depth]; // non 8-bit images will be larger
5166+
for (k = 0; k < s->img_n && k < 3; ++k)
5167+
tc[k] = (stbi_uc)(stbi__get16be(s) & 255) * stbi__depth_scale_table[z->depth]; // non 8-bit images will be larger
51655168
}
51665169
}
51675170
break;

0 commit comments

Comments
 (0)