mirror of
https://git.codelinaro.org/clo/qsdk/oss/boot/u-boot-2016.git
synced 2025-12-10 07:44:53 +01:00
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: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
9c55c54fb4
commit
670c0179ec
1 changed files with 3 additions and 1 deletions
|
|
@ -102,8 +102,10 @@ int lzop_decompress(const unsigned char *src, size_t src_len,
|
||||||
tmp = dlen;
|
tmp = dlen;
|
||||||
r = lzo1x_decompress_safe((u8 *) src, slen, dst, &tmp);
|
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;
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
if (dlen != tmp)
|
if (dlen != tmp)
|
||||||
return LZO_E_ERROR;
|
return LZO_E_ERROR;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue