Skip to content
Myr

stb_image: fix bug where bmp claimed to be 24-bit but also claimed to have an alpha bitfield

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Sean Barrett · committed by Sean Barrett · parent 61be29d · Browse files · 1 file+10 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+10 added−2 removed

  • other:+10 added−2 removed

1 file+10 added−2 removed

modified:stb_image.h+10 added-2 removed
5235 unmodified lines
5236 if (info.bpp < 16)5237 psize = (info.offset - 14 - info.hsz) >> 2;5238 }52395240 if (info.bpp == 24 && ma == 0xff000000)5241 s->img_n = 3;5242 else5240 s->img_n = ma ? 4 : 3;5243 s->img_n = ma ? 4 : 3;5244 if (req_comp && req_comp >= 3) // we can directly decode 3 or 45245 target = req_comp;5246 else5247 target = s->img_n; // if they want monochrome, we'll post-convert
1690 unmodified lines
6938 if (p == NULL)6939 return 0;6940 if (x) *x = s->img_x;6941 if (y) *y = s->img_y;6939 if (comp) *comp = info.ma ? 4 : 3;6942 if (comp) {6943 if (info.bpp == 24 && info.ma == 0xff000000)6944 *comp = 3;6945 else6946 *comp = info.ma ? 4 : 3;6947 }6948 return 1;6949}6950#endif6951
604 unmodified lines