diff --git a/hwpfilter/source/hwpread.cxx b/hwpfilter/source/hwpread.cxx index 325f74c5d358..becdb76773a6 100644 --- a/hwpfilter/source/hwpread.cxx +++ b/hwpfilter/source/hwpread.cxx @@ -310,6 +310,10 @@ int TxtBox::Read(HWPFile & hwpf) hwpf.ReadParaList(caption); if( type == 0 ){ // if table? + TCell* *pArr = ::comphelper::newArray_null(ncell); + if (!pArr) { + return hwpf.SetState(HWP_InvalidFileFormat); + } Table *tbl = new Table; for( ii = 0 ; ii < ncell; ii++) { @@ -318,10 +322,6 @@ int TxtBox::Read(HWPFile & hwpf) tbl->rows.insert(cell[ii].y); tbl->rows.insert(cell[ii].y + cell[ii].h); } - TCell* *pArr = ::comphelper::newArray_null(ncell); - if (!pArr) { - return hwpf.SetState(HWP_InvalidFileFormat); - } for( ii = 0 ; ii < ncell; ii++) { TCell *tcell = new TCell;