Index: lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/HunspellDictionaryTest.java
===================================================================
--- lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/HunspellDictionaryTest.java	(revision 1334950)
+++ lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/HunspellDictionaryTest.java	(working copy)
@@ -42,4 +42,20 @@
     affixStream.close();
     dictStream.close();
   }
+
+  @Test
+  public void testHunspellDictionary_loadDicWrongAff() throws IOException, ParseException {
+    InputStream affixStream = getClass().getResourceAsStream("test-wrong.aff");
+    InputStream dictStream = getClass().getResourceAsStream("test.dic");
+
+    HunspellDictionary dictionary = new HunspellDictionary(affixStream, dictStream, TEST_VERSION_CURRENT);
+    assertEquals(3, dictionary.lookupSuffix(new char[]{'e'}, 0, 1).size());
+    assertEquals(1, dictionary.lookupPrefix(new char[]{'s'}, 0, 1).size());
+    assertEquals(1, dictionary.lookupWord(new char[]{'o', 'l', 'r'}, 0, 3).size());
+    //malformed rule is not loaded
+    assertNull(dictionary.lookupPrefix(new char[]{'a'}, 0, 1));
+
+    affixStream.close();
+    dictStream.close();
+  }
 }
Index: lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/test-wrong.aff
===================================================================
--- lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/test-wrong.aff	(revision 0)
+++ lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/test-wrong.aff	(revision 0)
@@ -0,0 +1,24 @@
+SET UTF-8
+TRY abcdefghijklmopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
+
+SFX A Y 3
+SFX A   0     e         n
+SFX A   0     e         t
+SFX A   0     e         h
+
+SFX C Y 2
+SFX C   0     d/C       c
+SFX C   0     c         b
+
+SFX D Y 1
+SFX D   0     s         o
+
+SFX E Y 1
+SFX E   0     d         o
+
+PFX B Y 1
+PFX B   0     s         o
+
+#wrong rule (only 4 elements)
+PFX A0 Y 1
+PFX A0 0 a
\ No newline at end of file
Index: lucene/analysis/common/src/java/org/apache/lucene/analysis/hunspell/HunspellDictionary.java
===================================================================
--- lucene/analysis/common/src/java/org/apache/lucene/analysis/hunspell/HunspellDictionary.java	(revision 1334950)
+++ lucene/analysis/common/src/java/org/apache/lucene/analysis/hunspell/HunspellDictionary.java	(working copy)
@@ -197,6 +197,10 @@
       String line = reader.readLine();
       String ruleArgs[] = line.split("\\s+");
 
+      if (ruleArgs.length < 5) {
+        continue;
+      }
+
       HunspellAffix affix = new HunspellAffix();
       
       affix.setFlag(flagParsingStrategy.parseFlag(ruleArgs[1]));
