From 00261fa76a88105cdef8cfa3ad52559828f84f67 Mon Sep 17 00:00:00 2001 From: Maxim Valyanskiy Date: Thu, 21 Apr 2011 11:49:03 +0000 Subject: [PATCH] hwpf: ignore invalid style reference git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1095664 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/org/apache/poi/hwpf/model/StyleSheet.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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) -- 2.39.5