Przeglądaj źródła

lib: zlib: remove the limitation for cannot using 0 as start

We often need the requirement that compressing those memory range start
from 0, but the default deflate code in zlib prevent us to do this.
Considering the special case of uboot, that it could access all memory
range, it is reasonable to be able to also take the address space from 0
into compression.

Signed-off-by: Lei Wen <leiwen@marvell.com>
Lei Wen 12 lat temu
rodzic
commit
869c2abbaf
1 zmienionych plików z 1 dodań i 3 usunięć
  1. 1 3
      lib/zlib/deflate.c

+ 1 - 3
lib/zlib/deflate.c

@@ -592,9 +592,7 @@ int ZEXPORT deflate (strm, flush)
     }
     }
     s = strm->state;
     s = strm->state;
 
 
-    if (strm->next_out == Z_NULL ||
-        (strm->next_in == Z_NULL && strm->avail_in != 0) ||
-        (s->status == FINISH_STATE && flush != Z_FINISH)) {
+    if (s->status == FINISH_STATE && flush != Z_FINISH) {
         ERR_RETURN(strm, Z_STREAM_ERROR);
         ERR_RETURN(strm, Z_STREAM_ERROR);
     }
     }
     if (strm->avail_out == 0) ERR_RETURN(strm, Z_BUF_ERROR);
     if (strm->avail_out == 0) ERR_RETURN(strm, Z_BUF_ERROR);