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

ofz#798 oom

Change-Id: I6fa8dd999af7e00d6236a1ead5f8bb519f2d128d
üst 1353ebe5
......@@ -77,9 +77,6 @@ hchar_string HBox::GetString()
// skip block
SkipData::SkipData(hchar hch)
: HBox(hch)
, data_block_len(0)
, dummy(0)
, data_block(nullptr)
{
}
......
......@@ -68,18 +68,15 @@ struct HBox
};
/**
* @short Class for saving data to be skipped.
* @short Class for skipping data.
*/
struct SkipData: public HBox
{
uint data_block_len;
hchar dummy;
std::unique_ptr<char[]> data_block;
explicit SkipData(hchar);
virtual ~SkipData() override;
virtual bool Read(HWPFile &hwpf) override;
};
struct DateCode;
struct FieldCode : public HBox
{
......
......@@ -45,19 +45,19 @@ bool HBox::Read(HWPFile & )
bool SkipData::Read(HWPFile & hwpf)
{
uint data_block_len;
hwpf.Read4b(&data_block_len, 1);
hchar dummy;
hwpf.Read2b(&dummy, 1);
if (!(IS_SP_SKIP_BLOCK(hh) && (hh == dummy))){
return hwpf.SetState(HWP_InvalidFileFormat);
}
data_block.reset(new char[data_block_len]);
}
return hwpf.Read1b(data_block.get(), data_block_len);
return hwpf.SkipBlock(data_block_len);
}
// Field code(5)
bool FieldCode::Read(HWPFile & hwpf)
{
......
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