From 35918b2b50c5a66bbf8b6a4905f1b443c813896f Mon Sep 17 00:00:00 2001 From: Pavel Krajcevski Date: Thu, 26 Mar 2015 19:33:57 -0700 Subject: [PATCH] Make sure to set number of channels after doing post-conversion of grayscale BMP images --- stb_image.h | 1 + 1 file changed, 1 insertion(+) diff --git a/stb_image.h b/stb_image.h index c3945c2..5785637 100644 --- a/stb_image.h +++ b/stb_image.h @@ -4668,6 +4668,7 @@ static stbi_uc *stbi__bmp_load(stbi__context *s, int *x, int *y, int *comp, int if (req_comp && req_comp != target) { out = stbi__convert_format(out, target, req_comp, s->img_x, s->img_y); if (out == NULL) return out; // stbi__convert_format frees input on failure + s->img_n = req_comp; } *x = s->img_x;