From 3443b8fab94db7c88adc313026ec3deb764e53c6 Mon Sep 17 00:00:00 2001 From: Charles Samborski Date: Mon, 12 Feb 2018 11:07:34 +0100 Subject: [PATCH] Fix PNG color type read The color type is the byte at offset 9 in the IHDR PNG chunk (offset 13 from the chunk size and 25 since the start of the file). Shumway was incorrectly reading the byte 10 corresponding to the compression method. --- src/swf/parser/image.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/swf/parser/image.ts b/src/swf/parser/image.ts index 8e0fe5c0ec..9ac40c9bd0 100644 --- a/src/swf/parser/image.ts +++ b/src/swf/parser/image.ts @@ -90,7 +90,7 @@ module Shumway.SWF.Parser { } image.width = readInt32(bytes, ihdrOffset + 4); image.height = readInt32(bytes, ihdrOffset + 8); - var type = bytes[ihdrOffset + 14]; + var type = bytes[ihdrOffset + 13]; image.hasAlpha = type === 4 || type === 6; }