Skip to content

Commit

Permalink
Fix a known NULL-ptr dereference issue in stb
Browse files Browse the repository at this point in the history
Upstream PR awainting merge.
nothings/stb#1736
  • Loading branch information
hzeller committed Jan 9, 2025
1 parent ebd0926 commit 56a7c7c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions third_party/README
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Header-only third_party image decoding implementations
* STB: Public domain header-only image loading and manipulation. Find
Full repo on https://github.com/nothings/stb
This is from git submit 5c205738c191bcb0abc65c4febfa9bd25ff35234
with applied patch https://github.com/nothings/stb/pull/1736
* QOI: MIT licensed header-only implementation of https://qoiformat.org/
Full repo on https://github.com/phoboslab/qoi
This is from git submit f65b365318df43cd0d7de8b51473dabcbefc04a6
1 change: 1 addition & 0 deletions third_party/stb/stb_image.h
Original file line number Diff line number Diff line change
Expand Up @@ -1757,6 +1757,7 @@ static unsigned char *stbi__convert_format(unsigned char *data, int img_n, int r
int i,j;
unsigned char *good;

if (data == NULL) return data;
if (req_comp == img_n) return data;
STBI_ASSERT(req_comp >= 1 && req_comp <= 4);

Expand Down

0 comments on commit 56a7c7c

Please sign in to comment.