From: Ghislain Antony Vaillant <ghisvail@gmail.com>
Date: Thu, 15 Dec 2016 19:39:01 +0000
Subject: Fix build with libpng16

---
 .../modules/juce_graphics/image_formats/juce_PNGLoader.cpp          | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/JuceLibraryCode/modules/juce_graphics/image_formats/juce_PNGLoader.cpp b/JuceLibraryCode/modules/juce_graphics/image_formats/juce_PNGLoader.cpp
index fa3b887..955a461 100644
--- a/JuceLibraryCode/modules/juce_graphics/image_formats/juce_PNGLoader.cpp
+++ b/JuceLibraryCode/modules/juce_graphics/image_formats/juce_PNGLoader.cpp
@@ -396,8 +396,12 @@ Image PNGImageFormat::decodeImage (InputStream& in)
 
             png_set_add_alpha (pngReadStruct, 0xff, PNG_FILLER_AFTER);
 
+            png_bytep trans_alpha;
+            int num_trans;
+            png_get_tRNS(pngReadStruct, pngInfoStruct, &trans_alpha, &num_trans, NULL);
+
             bool hasAlphaChan = (colorType & PNG_COLOR_MASK_ALPHA) != 0
-                                  || pngInfoStruct->num_trans > 0;
+                                  || num_trans > 0;
 
             // Load the image into a temp buffer in the pnglib format..
             const size_t lineStride = width * 4;
