mirror of
https://git.codelinaro.org/clo/qsdk/oss/boot/u-boot-2016.git
synced 2025-12-10 07:44:53 +01:00
bzlib: Update destLen 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
3086c055a0
commit
362a0e43a3
1 changed files with 1 additions and 1 deletions
|
|
@ -1350,11 +1350,11 @@ int BZ_API(BZ2_bzBuffToBuffDecompress)
|
||||||
strm.avail_out = *destLen;
|
strm.avail_out = *destLen;
|
||||||
|
|
||||||
ret = BZ2_bzDecompress ( &strm );
|
ret = BZ2_bzDecompress ( &strm );
|
||||||
|
*destLen -= strm.avail_out;
|
||||||
if (ret == BZ_OK) goto output_overflow_or_eof;
|
if (ret == BZ_OK) goto output_overflow_or_eof;
|
||||||
if (ret != BZ_STREAM_END) goto errhandler;
|
if (ret != BZ_STREAM_END) goto errhandler;
|
||||||
|
|
||||||
/* normal termination */
|
/* normal termination */
|
||||||
*destLen -= strm.avail_out;
|
|
||||||
BZ2_bzDecompressEnd ( &strm );
|
BZ2_bzDecompressEnd ( &strm );
|
||||||
return BZ_OK;
|
return BZ_OK;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue