-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hunterized version 2023.10.12 #1
base: hunter-0.0.0-80c8f6a
Are you sure you want to change the base?
Hunterized version 2023.10.12 #1
Conversation
Fixes nothings#1011. As intended according to nothings#932 (comment).
It was never designed to be used by anyone but Sean and has numerous problems; new code should definitely not be using this.
This allows for compiler verification of the format string just like printf.
Also fix a "potentially uninitialized variable" warning. This is a modified version of Alan's original PR that keeps the table generator in the file (in case there's interest) and also replaces the expand[] tables with math, since it's trivial. Fixes issue nothings#1117.
Don't truncate error as aggressively; easily done, but wanted to keep it separate from the previous change.
Keep STB_DXT_DITHER so as not to break existing code that tries to enable it, but just leave it permanently off. I originally introduced it somewhat superstitiously because of the RGB565 endpoint resolution but it never improved either perceptual quality or objective quality metrics, and the code is appreciably simpler without it.
va_arg() is in stdarg.h, which is already being included
Should use xh argument not ph (which is the name of the variable that it actually gets instantiated with the one time it is used).
Fixes the bug covered by PR nothings#1066, but with a slightly different fix that's hopefully a bit clearer.
Fixes issue nothings#1041.
Accidentally introduced during a merge.
These two variables are unused on some targets, resulting in warnings. Add STBI_NOTUSED around them to suppress those warnings.
A few were missing. Make sure to always report ouf-of-memory errors. Fixes issue nothings#1056.
extend_receive implicitly requires n <= 15 (code length); the maximum that actually makes sense for 8-bit baseline JPEG is 11, but 15 is the natural limit for us because the AC coding path stores the number of magnitude bits in a nibble. Check that DC delta bits are in range before attempting to call extend_receive. Fixes issue nothings#1108.
Define lrot in a way that doesn't involve UB when n==0. Also, the previous patch ensures that n <= 15 for all callers of stbi__extend_receive, so can remove the (less restrictive) bounds check for 0 <= n < 17 (the bounds of stbi__bmask) entirely. Fixes issue nothings#1065.
For the stb_image fix, also replace the magic 288 with a more descriptive name while I'm at it. Fixes nothings#1100
Use an equivalent formulation that has sgn=0 or 1, not 0 or -1. This avoids right-shifting signed values, at least in this place. Fixes issue nothings#1061.
Specifically, this rejects length codes 286 and 287, and distance codes 30 and 31. This avoids a scenario in which a file could contain a table in which 0 corresponded to length code 287, which would result in writing 0 bits. Signed-off-by: Neil Bickford <[email protected]>
Bug reported by N-R-K. Fixes nothings#1276.
As suggested by "mupfdev" on Github. We don't have a way to test here but seems simple enough. Fixes issue nothings#1321.
Fixes issue nothings#1330 reported by lunasorcery.
Limit to 1k, which is the maximum size of a 256-entry palette that would ordinarily go there. It feels sensible to relax this a bit but we don't want to go overboard. Fixes issue nothings#1325.
Be a bit more picky about what we consider a valid marker. 0xff 0x00 (stuffed 0 byte) should not count. Fixes issue nothings#1409.
For paletted images, header-scanning mode (used by stbi_info) kept going after the image header to see if a tRNS (transparency) chunk shows up to correctly determine the channel count, but we would immediately return after IHDR for non-paletted images. This is incorrect. We also change our reported channel count on RGB images with a tRNS chunk, therefore non-paletted images also have to resume scanning further chunks. Update the logic to keep scanning regardless and report the correct channel count from stbi_info for RGB images with tRNS (constant alpha channel). Fixes issue nothings#1419.
d160088
to
a17b6ec
Compare
@NeroBurner the upstream repo lacks project versions (but individual headers are versioned), so the two most recent Hunterized versions have used the version naming convention "0.0.0--pX". |
- Update paths used in GenerateHeader(...) calls - Require CMake 3.5+ as per Hunter project - Update version number: use YYYYMMDD notation because the upstream repo is not versioned
dd7e5a8
to
10beb04
Compare
let's do a mix. Use a version number the timestamp of the commit and as extension the short-sha. Then we can easily find the commit with the short-sha and also easily understand the chronological ordering So the version in CMake should (or could be) Please also add a comment in |
Updates to tip of upstream master branch.
Incorporates all Hunterization from previous v0.0.0-80c8f6a-p0 version, and makes minor updates to CMakeLists.txt .
Fixes a couple of trivial compile errors.
Adopts a YYYY-MM-DD based versioning scheme, since the upstream project lacks an overall version number.