summaryrefslogtreecommitdiff
path: root/stb_image.h
diff options
context:
space:
mode:
authorquou <quou@disroot.org>2024-06-02 21:46:07 +1000
committerquou <quou@disroot.org>2024-06-02 21:47:26 +1000
commit62b4a3ededd237f4b4850d91c052585e2f687499 (patch)
tree25bf590a634c6c71f399cf9b1d620500f06b8b9f /stb_image.h
parent2e761bdb8badecdbda2925a056a6d5aa3e3cac83 (diff)
Switched to luigi, parsing out FLAC metadata.
Diffstat (limited to 'stb_image.h')
-rw-r--r--stb_image.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/stb_image.h b/stb_image.h
index a632d54..9eedabe 100644
--- a/stb_image.h
+++ b/stb_image.h
@@ -1,4 +1,4 @@
-/* stb_image - v2.29 - public domain image loader - http://nothings.org/stb
+/* stb_image - v2.30 - public domain image loader - http://nothings.org/stb
no warranty implied; use at your own risk
Do this:
@@ -48,6 +48,7 @@ LICENSE
RECENT REVISION HISTORY:
+ 2.30 (2024-05-31) avoid erroneous gcc warning
2.29 (2023-05-xx) optimizations
2.28 (2023-01-29) many error fixes, security errors, just tons of stuff
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)
// non-paletted with tRNS = constant alpha. if header-scanning, we can stop now.
if (scan == STBI__SCAN_header) { ++s->img_n; return 1; }
if (z->depth == 16) {
- for (k = 0; k < s->img_n; ++k) tc16[k] = (stbi__uint16)stbi__get16be(s); // copy the values as-is
+ for (k = 0; k < s->img_n && k < 3; ++k) // extra loop test to suppress false GCC warning
+ tc16[k] = (stbi__uint16)stbi__get16be(s); // copy the values as-is
} else {
- 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
+ for (k = 0; k < s->img_n && k < 3; ++k)
+ tc[k] = (stbi_uc)(stbi__get16be(s) & 255) * stbi__depth_scale_table[z->depth]; // non 8-bit images will be larger
}
}
break;