提交 670c0179 编写于 作者: S Simon Glass 提交者: Tom Rini

lzo: Update dst_len even on error

This allows the caller to easily detect how much of the destination buffer
has been used.
Signed-off-by: NSimon Glass <sjg@chromium.org>
上级 9c55c54f
......@@ -102,8 +102,10 @@ int lzop_decompress(const unsigned char *src, size_t src_len,
tmp = dlen;
r = lzo1x_decompress_safe((u8 *) src, slen, dst, &tmp);
if (r != LZO_E_OK)
if (r != LZO_E_OK) {
*dst_len = dst - start;
return r;
}
if (dlen != tmp)
return LZO_E_ERROR;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册