u-boot/lib/zlib
Anatolij Gustschin 92faa8b109 zlib: handle overflow while calculating available stream input size
If compressed data is located in sectors at the end of the flash and
it's offset + input stream size > 0xFFFFFFFF, the uncompressing time
is very long, since processing of the stream is done bytewise (and
not blockwise) due to overflow in inflate_fast() while calculation
and checking for enough input available.

Check for this overflow condition and limit the available stream
input size to the actually max. possible input size. This fixes
the problem.

The issue is easily reproduceable by placing a gziped bitmap in flash,
e.g. at FFF80000, and running 'bmp' commands like 'bmp info FFF80000'
or 'bmp display FFF80000'. The uncompressing can take up to 3 sec.
whereas it should normaly take a fraction of a second. If the
'splashimage' environment variable points to this address, the
booting time also increases significantly.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
2011-10-17 21:45:35 +02:00
..
adler32.c zlib: split up to match original source tree 2011-04-30 20:21:45 +02:00
inffast.c zlib: handle overflow while calculating available stream input size 2011-10-17 21:45:35 +02:00
inffast.h zlib: split up to match original source tree 2011-04-30 20:21:45 +02:00
inffixed.h zlib: split up to match original source tree 2011-04-30 20:21:45 +02:00
inflate.c zlib: split up to match original source tree 2011-04-30 20:21:45 +02:00
inflate.h zlib: split up to match original source tree 2011-04-30 20:21:45 +02:00
inftrees.c zlib: split up to match original source tree 2011-04-30 20:21:45 +02:00
inftrees.h zlib: split up to match original source tree 2011-04-30 20:21:45 +02:00
Makefile zlib: split up to match original source tree 2011-04-30 20:21:45 +02:00
zlib.c zlib: split up to match original source tree 2011-04-30 20:21:45 +02:00
zlib.h zlib: split up to match original source tree 2011-04-30 20:21:45 +02:00
zutil.c zlib: split up to match original source tree 2011-04-30 20:21:45 +02:00
zutil.h zlib: fix DEBUG build 2011-05-12 19:30:29 +02:00