From afd9b62f00cd4557b32dae5bed6ed40320f86857 Mon Sep 17 00:00:00 2001 From: Keisuke Kuroyanagi Date: Thu, 20 Feb 2014 18:11:17 +0900 Subject: [PATCH] Throw IOException when dict header cannot be read. Bug: 13106638 Change-Id: Ib48ef0a191a436552c49b6e817dfa13fe1567ae8 --- .../android/inputmethod/latin/makedict/Ver4DictDecoder.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/java/src/com/android/inputmethod/latin/makedict/Ver4DictDecoder.java b/java/src/com/android/inputmethod/latin/makedict/Ver4DictDecoder.java index 23aa05d18..88fff38f2 100644 --- a/java/src/com/android/inputmethod/latin/makedict/Ver4DictDecoder.java +++ b/java/src/com/android/inputmethod/latin/makedict/Ver4DictDecoder.java @@ -53,6 +53,10 @@ public class Ver4DictDecoder extends AbstractDictDecoder { @Override public DictionaryHeader readHeader() throws IOException, UnsupportedFormatException { + final DictionaryHeader header = mBinaryDictionary.getHeader(); + if (header == null) { + throw new IOException("Cannot read the dictionary header."); + } return mBinaryDictionary.getHeader(); }