Skip to content

Commit 952cca2

Browse files
committed
Update stb_image to 2.30
1 parent c81e974 commit 952cca2

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

3rdparty/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@
218218

219219
## stb (stb_image)
220220
- Upstream: https://github.com/nothings/stb
221-
- Version: 2.29
221+
- Version: 2.30
222222
- License: MIT
223223

224224
## unzip (minizip-1.2)

3rdparty/stb/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)