diff options
Diffstat (limited to 'hwpfilter')
-rw-r--r-- | hwpfilter/source/hiodev.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/hwpfilter/source/hiodev.cxx b/hwpfilter/source/hiodev.cxx index 56d4719e4302..a9bd14b57b11 100644 --- a/hwpfilter/source/hiodev.cxx +++ b/hwpfilter/source/hiodev.cxx @@ -337,7 +337,7 @@ size_t HMemIODev::readBlock(void *p, size_t size) { if (state()) return 0; - if (length < pos + size) + if (size > length - pos) size = length - pos; memcpy(p, ptr + pos, size); pos += size; @@ -346,7 +346,7 @@ size_t HMemIODev::readBlock(void *p, size_t size) size_t HMemIODev::skipBlock(size_t size) { - if (state() || length < pos + size) + if (state() || size > length - pos) return 0; pos += size; return size; |