forked from hunter-packages/stb
-
Notifications
You must be signed in to change notification settings - Fork 2
Hunter 2025.05.12 802cd454 #2
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
Open
jg-x2x
wants to merge
262
commits into
cpp-pm:hunter-0.0.0-80c8f6a
Choose a base branch
from
jg-x2x:hunter-0.0.0-802cd454
base: hunter-0.0.0-80c8f6a
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Hunter 2025.05.12 802cd454 #2
jg-x2x
wants to merge
262
commits into
cpp-pm:hunter-0.0.0-80c8f6a
from
jg-x2x:hunter-0.0.0-802cd454
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
It's implementation-specified behavior. Writing this code and then relying on compiler strength reduction to turn it back into shifts feels extremely silly but it is what it is. Fixes issue nothings#1097.
As per recent patches, we do support 16-bit PNMs.
Need to do the second-part shift on uint32 not int.
There was both the assert and the error check; should just be the error check. Fixes issue nothings#881 (or rather, part of it).
Try to be a bit more explicit still. Fixes issue nothings#903, or so I hope.
Both the buffer size limits and the image dimension limits. Fixes issue nothings#672.
`stb_image_resize2.h:6734:5: runtime error: member access within null pointer of type 'stbir__info' (aka 'struct stbir__info')`
add specific issue for stb_image incorrect load
fixed a bug when using input callbacks, turned off simd for tiny-c, fixed some variables that should have been static, fixes a bug when calculating temp memory with resizes that exceed 2GB of temp memory (very large resizes).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Updated to latest master and add some compile fixes for new versions of Xcode and upcoming CMake 4
Adopted versioning system as suggested in the previous PR:
Builds successfully on local machine: