Skip to content

Commit

Permalink
stb_image: add pbm support
Browse files Browse the repository at this point in the history
  • Loading branch information
plzombie committed May 16, 2023
1 parent 031b079 commit 9ec45a1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion stb_image.h
Original file line number Diff line number Diff line change
Expand Up @@ -7521,7 +7521,7 @@ static void *stbi__pnm_load(stbi__context *s, int *x, int *y, int *comp, int req
if (!stbi__mad4sizes_valid(s->img_n, s->img_x, s->img_y, ri->bits_per_channel / 8, 0))
return stbi__errpuc("too large", "PNM too large");

if (ri->bits_per_channel) bytes_per_channel = 2; else bytes_per_channel = 1;
if (ri->bits_per_channel == 16) bytes_per_channel = 2; else bytes_per_channel = 1;
out = (stbi_uc *) stbi__malloc_mad4(s->img_n, s->img_x, s->img_y, bytes_per_channel, 0);
if (!out) return stbi__errpuc("outofmem", "Out of memory");
if (ri->bits_per_channel == 1) {
Expand Down

0 comments on commit 9ec45a1

Please sign in to comment.