diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-09-22 12:19:38 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-09-22 17:32:09 +0200 |
commit | c75a3ffd88732f424f8f557c94e580ecc54f551f (patch) | |
tree | 48a27532bcf3d66a796d1b9d31e3f1bcc166bbd8 /hwpfilter | |
parent | e69ed74e34712419c0c3737b6bb846be11d4e460 (diff) |
ofz: alloc+read+discard -> skipblock
Change-Id: I51aa0a1155c468aa5d360c63f6f7c8d347078bf1
Reviewed-on: https://gerrit.libreoffice.org/42638
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'hwpfilter')
-rw-r--r-- | hwpfilter/source/htags.cxx | 8 | ||||
-rw-r--r-- | hwpfilter/source/htags.h | 2 |
2 files changed, 3 insertions, 7 deletions
diff --git a/hwpfilter/source/htags.cxx b/hwpfilter/source/htags.cxx index 6bccf5c85bbc..f9952e009f8b 100644 --- a/hwpfilter/source/htags.cxx +++ b/hwpfilter/source/htags.cxx @@ -72,14 +72,13 @@ bool EmPicture::Read(HWPFile & hwpf) OlePicture::OlePicture(int tsize) : signature(0) +#ifdef _WIN32 , pis(nullptr) +#endif { size = tsize - 4; if (size <= 0) return; -#ifndef _WIN32 - pis.reset( new char[size] ); -#endif }; OlePicture::~OlePicture() @@ -130,8 +129,7 @@ void OlePicture::Read(HWPFile & hwpf) } unlink(tname); #else - if (pis == nullptr || hwpf.ReadBlock(pis.get(), size) == 0) - return; + hwpf.SkipBlock(size); #endif } diff --git a/hwpfilter/source/htags.h b/hwpfilter/source/htags.h index 2bf52b66a96f..3507633b0294 100644 --- a/hwpfilter/source/htags.h +++ b/hwpfilter/source/htags.h @@ -62,8 +62,6 @@ struct OlePicture uint signature; #ifdef _WIN32 IStorage *pis; -#else - std::unique_ptr<char[]> pis; #endif explicit OlePicture(int tsize); ~OlePicture(void); |