From 8d708835d8136559e8ff750628cedf947cd8a17a Mon Sep 17 00:00:00 2001 From: "honfika@gmail.com" Date: Sun, 25 Sep 2016 15:09:59 +0200 Subject: [PATCH] SVG import fix --- .../flash/importers/svg/SvgPathReader.java | 28 +++++++++++-------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/importers/svg/SvgPathReader.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/importers/svg/SvgPathReader.java index 8c09d68fd..5e12bad8a 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/importers/svg/SvgPathReader.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/importers/svg/SvgPathReader.java @@ -78,27 +78,33 @@ public class SvgPathReader { int startPos = pos; readWhiteSpaces(); - char ch = str.charAt(pos); + + char ch; + ch = str.charAt(pos); if (ch == '-') { pos++; } digitSequence(); - ch = str.charAt(pos); - if (ch == '.') { - pos++; - digitSequence(); + if (hasNext()) { + ch = str.charAt(pos); + if (ch == '.') { + pos++; + digitSequence(); + } } - ch = str.charAt(pos); - if (ch == 'e') { - pos++; + if (hasNext()) { ch = str.charAt(pos); - if (ch == '-') { + if (ch == 'e') { pos++; - } + ch = str.charAt(pos); + if (ch == '-') { + pos++; + } - digitSequence(); + digitSequence(); + } } boolean ok = false;