summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2014-10-29 15:31:20 -0700
committerTom Sepez <tsepez@chromium.org>2014-10-29 15:31:20 -0700
commitf3a5d3ddf7b492e5e8f64cb2ee98a53b5520499d (patch)
treefca515b67e8a1501171657ad4f9317e6a458a052 /core/src/fpdfapi
parent4dc95e74e1acc75f4eab08bc771874cd2a9c3a9b (diff)
downloadpdfium-f3a5d3ddf7b492e5e8f64cb2ee98a53b5520499d.tar.xz
Resolve compilation error with G++ 4.9.
Add a check for zero-length keys to avoid hitting the equivalent of |""[1]|. BUG=https://code.google.com/p/pdfium/issues/detail?id=58 R=jun_fang@foxitsoftware.com Review URL: https://codereview.chromium.org/665223003
Diffstat (limited to 'core/src/fpdfapi')
-rw-r--r--core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp
index e9c0fdd227..5df4a6ff7f 100644
--- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp
+++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp
@@ -2192,9 +2192,7 @@ CPDF_Object* CPDF_SyntaxParser::GetObject(CPDF_IndirectObjects* pObjList, FX_DWO
if (pObj == NULL) {
continue;
}
- if (key.GetLength() == 1) {
- pDict->SetAt(CFX_ByteStringC(((FX_LPCSTR)key) + 1, key.GetLength() - 1), pObj);
- } else {
+ if (key.GetLength() >= 1) {
if (nKeys < 32) {
pDict->SetAt(CFX_ByteStringC(((FX_LPCSTR)key) + 1, key.GetLength() - 1), pObj);
} else {