u-boot/lib
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
..
libfdt libfdt: Implement property iteration functions 2011-07-14 21:10:34 -04:00
lzma Convert ISO-8859 files to UTF-8 2011-08-04 23:34:02 +02:00
lzo GCC4.6: Squash warning in lzo1x_decompress.c 2011-10-01 23:34:38 +02:00
zlib zlib: handle overflow while calculating available stream input size 2011-10-17 21:45:35 +02:00
addr_map.c Rename lib_generic/ to lib/ 2010-04-13 09:13:04 +02:00
asm-offsets.c Small coding style fix in lib/asm-offsets.c 2011-01-17 22:55:58 +01:00
bzlib.c Rename lib_generic/ to lib/ 2010-04-13 09:13:04 +02:00
bzlib_crctable.c Rename lib_generic/ to lib/ 2010-04-13 09:13:04 +02:00
bzlib_decompress.c Rename lib_generic/ to lib/ 2010-04-13 09:13:04 +02:00
bzlib_huffman.c Rename lib_generic/ to lib/ 2010-04-13 09:13:04 +02:00
bzlib_private.h Rename lib_generic/ to lib/ 2010-04-13 09:13:04 +02:00
bzlib_randtable.c Rename lib_generic/ to lib/ 2010-04-13 09:13:04 +02:00
circbuf.c Rename lib_generic/ to lib/ 2010-04-13 09:13:04 +02:00
crc7.c lib: add crc7 from Linux 2011-01-18 23:38:08 +01:00
crc16.c Rename lib_generic/ to lib/ 2010-04-13 09:13:04 +02:00
crc32.c Rename lib_generic/ to lib/ 2010-04-13 09:13:04 +02:00
ctype.c ctype: constify lookup table 2010-11-28 21:58:29 +01:00
display_options.c unify version_string 2011-07-28 17:22:53 +02:00
div64.c Move arch/ppc to arch/powerpc 2010-04-21 23:42:38 +02:00
errno.c Add basic errno support. 2010-09-19 19:29:47 +02:00
gunzip.c Fix gunzip to work for any gziped uImage size 2011-04-12 22:58:30 +02:00
hashtable.c Constify getenv(), setenv() and hash code functions 2011-07-30 01:37:44 +02:00
ldiv.c Rename lib_generic/ to lib/ 2010-04-13 09:13:04 +02:00
lmb.c Rename lib_generic/ to lib/ 2010-04-13 09:13:04 +02:00
Makefile scaled down version of generic libraries for SPL 2011-07-26 14:44:25 +02:00
md5.c Rename lib_generic/ to lib/ 2010-04-13 09:13:04 +02:00
net_utils.c string_to_ip: constify "s" arg 2010-11-28 21:56:39 +01:00
qsort.c Add assert() for debug assertions 2011-09-10 00:04:01 +02:00
rbtree.c Rename lib_generic/ to lib/ 2010-04-13 09:13:04 +02:00
sha1.c Rename lib_generic/ to lib/ 2010-04-13 09:13:04 +02:00
sha256.c Rename lib_generic/ to lib/ 2010-04-13 09:13:04 +02:00
string.c memcpy/memmove: Do not copy to same address 2011-07-26 00:28:44 +02:00
strmhz.c strmhz: Make hz unsigned to support greater than 2146 MHz clock 2011-03-22 23:34:36 +01:00
time.c Rename lib_generic/ to lib/ 2010-04-13 09:13:04 +02:00
vsprintf.c Add assert() for debug assertions 2011-09-10 00:04:01 +02:00