summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2014-12-02 13:17:38 -0700
committerTom Rini <trini@ti.com>2015-01-14 11:35:44 -0500
commit362a0e43a37aa5a6316bcf895def4eda8391bb2e (patch)
tree8fa486d2f3e18560259877c6cb1abbd14c52cb2c /lib
parent3086c055a073049dcfb1f01bc5c682bd947a1caa (diff)
downloadu-boot-imx-362a0e43a37aa5a6316bcf895def4eda8391bb2e.zip
u-boot-imx-362a0e43a37aa5a6316bcf895def4eda8391bb2e.tar.gz
u-boot-imx-362a0e43a37aa5a6316bcf895def4eda8391bb2e.tar.bz2
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>
Diffstat (limited to 'lib')
-rw-r--r--lib/bzip2/bzlib.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/bzip2/bzlib.c b/lib/bzip2/bzlib.c
index 5844e18..9262e40 100644
--- a/lib/bzip2/bzlib.c
+++ b/lib/bzip2/bzlib.c
@@ -1350,11 +1350,11 @@ int BZ_API(BZ2_bzBuffToBuffDecompress)
strm.avail_out = *destLen;
ret = BZ2_bzDecompress ( &strm );
+ *destLen -= strm.avail_out;
if (ret == BZ_OK) goto output_overflow_or_eof;
if (ret != BZ_STREAM_END) goto errhandler;
/* normal termination */
- *destLen -= strm.avail_out;
BZ2_bzDecompressEnd ( &strm );
return BZ_OK;