diff options
author | 2013-08-13 01:40:19 -0700 | |
---|---|---|
committer | 2013-08-13 01:40:19 -0700 | |
commit | 855e6a22c8ec848f10ba595a85d350eacea47b19 (patch) | |
tree | 74acd92b21d31bbcdcf0d7bc0568de274475e20c /java/src | |
parent | 099fc9d08129524638701cd7af847113d2959e3a (diff) | |
parent | 7242bf1a159b909db8a7c74e786e2391a4361d85 (diff) | |
download | latinime-855e6a22c8ec848f10ba595a85d350eacea47b19.tar.gz latinime-855e6a22c8ec848f10ba595a85d350eacea47b19.tar.xz latinime-855e6a22c8ec848f10ba595a85d350eacea47b19.zip |
am 7242bf1a: Merge "Make readHeader check the header size before using it."
* commit '7242bf1a159b909db8a7c74e786e2391a4361d85':
Make readHeader check the header size before using it.
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/com/android/inputmethod/latin/makedict/BinaryDictInputOutput.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/java/src/com/android/inputmethod/latin/makedict/BinaryDictInputOutput.java b/java/src/com/android/inputmethod/latin/makedict/BinaryDictInputOutput.java index e2fa0231d..e0874bbd5 100644 --- a/java/src/com/android/inputmethod/latin/makedict/BinaryDictInputOutput.java +++ b/java/src/com/android/inputmethod/latin/makedict/BinaryDictInputOutput.java @@ -1683,13 +1683,14 @@ public final class BinaryDictInputOutput { final HashMap<String, String> attributes = new HashMap<String, String>(); final int headerSize; headerSize = buffer.readInt(); - populateOptions(buffer, headerSize, attributes); - buffer.position(headerSize); if (headerSize < 0) { throw new UnsupportedFormatException("header size can't be negative."); } + populateOptions(buffer, headerSize, attributes); + buffer.position(headerSize); + final FileHeader header = new FileHeader(headerSize, new FusionDictionary.DictionaryOptions(attributes, 0 != (optionsFlags & FormatSpec.GERMAN_UMLAUT_PROCESSING_FLAG), |