From 3d303128f46927a29fe0263147fa61ea73b8f145 Mon Sep 17 00:00:00 2001 From: Lilith River Date: Fri, 24 Apr 2020 14:21:47 -0600 Subject: [PATCH] Fix #158 --- c_components/lib/codecs_png.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/c_components/lib/codecs_png.c b/c_components/lib/codecs_png.c index 830da06ab..4acf74d75 100644 --- a/c_components/lib/codecs_png.c +++ b/c_components/lib/codecs_png.c @@ -223,7 +223,11 @@ static bool flow_codecs_png_decoder_BeginRead(flow_c * c, struct flow_codecs_png if (!(state->color_type & PNG_COLOR_MASK_ALPHA)) { png_set_expand(state->png_ptr); png_set_filler(state->png_ptr, 65535L, PNG_FILLER_AFTER); - state->canvas_fmt = flow_bgr32; + if (state->color_type == PNG_COLOR_TYPE_PALETTE){ + state->canvas_fmt = flow_bgra32; + }else{ + state->canvas_fmt = flow_bgr32; + } } else { state->canvas_fmt = flow_bgra32; }