diff options
Diffstat (limited to 'hwpfilter/source/htags.cxx')
-rw-r--r-- | hwpfilter/source/htags.cxx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/hwpfilter/source/htags.cxx b/hwpfilter/source/htags.cxx index 30244a83f9b8..94cc05058d7c 100644 --- a/hwpfilter/source/htags.cxx +++ b/hwpfilter/source/htags.cxx @@ -59,9 +59,10 @@ bool HyperText::Read(HWPFile & hwpf) } -EmPicture::EmPicture(int tsize):size(tsize - 32) +EmPicture::EmPicture(size_t tsize) + : size(tsize >= 32 ? tsize - 32 : 0) { - if (size <= 0) + if (size == 0) data = 0; else data = new uchar[size]; @@ -82,7 +83,7 @@ EmPicture::~EmPicture(void) bool EmPicture::Read(HWPFile & hwpf) { - if (size <= 0) + if (size == 0) return false; hwpf.Read1b(name, 16); hwpf.Read1b(type, 16); |