[vlc-commits] PNG: fix transparency mask wrongly decoded

Diogo Silva git at videolan.org
Fri Apr 14 22:44:14 CEST 2017


vlc | branch: master | Diogo Silva <dbtdsilva at gmail.com> | Fri Apr 14 19:25:52 2017 +0100| [4bbc46a7cbc507ee04e6044d36171564d30d779a] | committer: Jean-Baptiste Kempf

PNG: fix transparency mask wrongly decoded

Close #18225

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4bbc46a7cbc507ee04e6044d36171564d30d779a
---

 modules/codec/png.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/modules/codec/png.c b/modules/codec/png.c
index dc91b775b5..75f3ad440b 100644
--- a/modules/codec/png.c
+++ b/modules/codec/png.c
@@ -261,6 +261,8 @@ static int DecodeBlock( decoder_t *p_dec, block_t *p_block )
     if( i_color_type == PNG_COLOR_TYPE_GRAY ||
         i_color_type == PNG_COLOR_TYPE_GRAY_ALPHA )
           png_set_gray_to_rgb( p_png );
+    if( i_color_type & PNG_COLOR_MASK_ALPHA )
+        png_set_alpha_mode( p_png, PNG_ALPHA_STANDARD, PNG_GAMMA_LINEAR );
 
     /* Strip to 8 bits per channel */
     if( i_bit_depth == 16 ) png_set_strip_16( p_png );



More information about the vlc-commits mailing list