Kaydet (Commit) c75a3ffd authored tarafından Caolán McNamara's avatar Caolán McNamara

ofz: alloc+read+discard -> skipblock

Change-Id: I51aa0a1155c468aa5d360c63f6f7c8d347078bf1
Reviewed-on: https://gerrit.libreoffice.org/42638Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst e69ed74e
......@@ -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
}
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment