diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-08-29 08:40:34 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-08-29 11:07:17 +0200 |
commit | 0a76305503e773c2052ee666d64b473bcbe815ff (patch) | |
tree | 7d4df2d1950d9724605ac60c36c9807c92499d4b /hwpfilter/source/htags.cxx | |
parent | f9601b9232589bbb704f10073bf9b1516af5a923 (diff) |
ofz#3201: avoid oom
Change-Id: Ia8e171a003f24c73c7f53ca7240e03c6f2492ad3
Reviewed-on: https://gerrit.libreoffice.org/41670
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'hwpfilter/source/htags.cxx')
-rw-r--r-- | hwpfilter/source/htags.cxx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/hwpfilter/source/htags.cxx b/hwpfilter/source/htags.cxx index ddd9438e0358..6bccf5c85bbc 100644 --- a/hwpfilter/source/htags.cxx +++ b/hwpfilter/source/htags.cxx @@ -25,13 +25,13 @@ #include "hwpfile.h" #include "htags.h" -void HyperText::Read(HWPFile & hwpf) +bool HyperText::Read(HWPFile& hwpf) { - hwpf.Read1b(filename, 256); - hwpf.Read2b(bookmark, 16); - hwpf.Read1b(macro, 325); - hwpf.Read1b(&type, 1); - hwpf.Read1b(reserve, 3); + size_t nRead = hwpf.Read1b(filename, 256); + nRead += hwpf.Read2b(bookmark, 16); + nRead += hwpf.Read1b(macro, 325); + nRead += hwpf.Read1b(&type, 1); + nRead += hwpf.Read1b(reserve, 3); if( type == 2 ) { for( int i = 1; i < 256; i++) @@ -41,9 +41,9 @@ void HyperText::Read(HWPFile & hwpf) break; } } + return nRead == 617; } - EmPicture::EmPicture(size_t tsize) : size(tsize >= 32 ? tsize - 32 : 0) { |