From: Maxim Valyanskiy Date: Thu, 21 Apr 2011 11:49:03 +0000 (+0000) Subject: hwpf: ignore invalid style reference X-Git-Tag: REL_3_8_BETA3~55 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=00261fa76a88105cdef8cfa3ad52559828f84f67;p=poi.git hwpf: ignore invalid style reference git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1095664 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/StyleSheet.java b/src/scratchpad/src/org/apache/poi/hwpf/model/StyleSheet.java index 2d10335c9f..5cbe03a881 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/model/StyleSheet.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/StyleSheet.java @@ -316,7 +316,12 @@ public final class StyleSheet implements HDFType { { return NIL_CHP; } - return (_styleDescriptions[x] != null ? _styleDescriptions[x].getCHP() : null); + + if (x>=_styleDescriptions.length) { + return NIL_CHP; + } + + return (_styleDescriptions[x] != null ? _styleDescriptions[x].getCHP() : NIL_CHP); } public ParagraphProperties getParagraphStyle(int x)