Skip to content

Commit

Permalink
Fix for unchecked malloc return value: nothings#1645
Browse files Browse the repository at this point in the history
  • Loading branch information
NBickford-NV committed May 22, 2024
1 parent f3869f8 commit 2c63ad9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions stb_image_write.h
Original file line number Diff line number Diff line change
Expand Up @@ -765,6 +765,8 @@ static int stbi_write_hdr_core(stbi__write_context *s, int x, int y, int comp, f
else {
// Each component is stored separately. Allocate scratch space for full output scanline.
unsigned char *scratch = (unsigned char *) STBIW_MALLOC(x*4);
if (NULL == scratch)
return 0;
int i, len;
char buffer[128];
char header[] = "#?RADIANCE\n# Written by stb_image_write.h\nFORMAT=32-bit_rle_rgbe\n";
Expand Down

0 comments on commit 2c63ad9

Please sign in to comment.