Png text decompression dos fix, for 2.6.x

Same as in master, but for 2.6.x