summaryrefslogtreecommitdiff
path: root/core/src/fxge/ge
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2015-11-02 14:09:31 -0800
committerLei Zhang <thestig@chromium.org>2015-11-02 14:09:31 -0800
commitbda74a5a272066f819f29d7e24dd914e0eeea455 (patch)
tree2e8f0e74d8a2b3b79365eefe92cf03c774a14d5c /core/src/fxge/ge
parentb45182122d4cade92d1dfddb6b278978c09475af (diff)
downloadpdfium-bda74a5a272066f819f29d7e24dd914e0eeea455.tar.xz
Merge to XFA: Check fread() return values in CFX_FolderFontInfo::GetFontData().
Check fseek() return values too. BUG=549998 TBR=thakis@chromium.org Review URL: https://codereview.chromium.org/1419793003 . (cherry picked from commit 99818557c8ed64d00fcc23a1e87e1ebf41ed5e85) Review URL: https://codereview.chromium.org/1426263002 .
Diffstat (limited to 'core/src/fxge/ge')
-rw-r--r--core/src/fxge/ge/fx_ge_fontmap.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/core/src/fxge/ge/fx_ge_fontmap.cpp b/core/src/fxge/ge/fx_ge_fontmap.cpp
index 1360fc795d..96e11300d0 100644
--- a/core/src/fxge/ge/fx_ge_fontmap.cpp
+++ b/core/src/fxge/ge/fx_ge_fontmap.cpp
@@ -1601,8 +1601,10 @@ FX_DWORD CFX_FolderFontInfo::GetFontData(void* hFont,
}
}
if (datasize && size >= datasize && pFile) {
- FXSYS_fseek(pFile, offset, FXSYS_SEEK_SET);
- FXSYS_fread(buffer, datasize, 1, pFile);
+ if (FXSYS_fseek(pFile, offset, FXSYS_SEEK_SET) < 0 ||
+ FXSYS_fread(buffer, datasize, 1, pFile) != 1) {
+ datasize = 0;
+ }
}
if (pFile) {
FXSYS_fclose(pFile);