提交 a013c036 编写于 作者: S Sean Barrett

initialize bmp mr/mg/mb/ma properly

上级 218ecd17
...@@ -4724,6 +4724,7 @@ static void *stbi__bmp_parse_header(stbi__context *s, stbi__bmp_data *info) ...@@ -4724,6 +4724,7 @@ static void *stbi__bmp_parse_header(stbi__context *s, stbi__bmp_data *info)
stbi__get16le(s); // discard reserved stbi__get16le(s); // discard reserved
info->offset = stbi__get32le(s); info->offset = stbi__get32le(s);
info->hsz = hsz = stbi__get32le(s); info->hsz = hsz = stbi__get32le(s);
info->mr = info->mg = info->mb = info->ma = 0;
if (hsz != 12 && hsz != 40 && hsz != 56 && hsz != 108 && hsz != 124) return stbi__errpuc("unknown BMP", "BMP type not supported: unknown"); if (hsz != 12 && hsz != 40 && hsz != 56 && hsz != 108 && hsz != 124) return stbi__errpuc("unknown BMP", "BMP type not supported: unknown");
if (hsz == 12) { if (hsz == 12) {
...@@ -4752,7 +4753,6 @@ static void *stbi__bmp_parse_header(stbi__context *s, stbi__bmp_data *info) ...@@ -4752,7 +4753,6 @@ static void *stbi__bmp_parse_header(stbi__context *s, stbi__bmp_data *info)
stbi__get32le(s); stbi__get32le(s);
} }
if (info->bpp == 16 || info->bpp == 32) { if (info->bpp == 16 || info->bpp == 32) {
info->mr = info->mg = info->mb = 0;
if (compress == 0) { if (compress == 0) {
if (info->bpp == 32) { if (info->bpp == 32) {
info->mr = 0xffu << 16; info->mr = 0xffu << 16;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册