* Fix bug in LZO

This commit is contained in:
Phillip 2014-05-23 21:38:41 -07:00
parent dfb0ce0b4f
commit 32f5b9cc03
1 changed files with 6 additions and 0 deletions

View File

@ -74,6 +74,12 @@ static void copy(LZOContext *c, int cnt) {
cnt = c->out_end - dst; cnt = c->out_end - dst;
c->error |= LZO_OUTPUT_FULL; c->error |= LZO_OUTPUT_FULL;
} }
if (cnt <= 0) {
c->error |= LZO_ERROR;
return;
}
#if defined(INBUF_PADDED) && defined(OUTBUF_PADDED) #if defined(INBUF_PADDED) && defined(OUTBUF_PADDED)
dst[0] = src[0]; dst[0] = src[0];
dst[1] = src[1]; dst[1] = src[1];