* [U-Boot] [PATCH] Fix gunzip to work for any gzipped uImage size Signed-off-by: Catalin Radu <Catalin@VirtualMetrix.com>
@ 2011-02-02 16:41 Catalin Radu
2011-02-03 12:57 ` Sergei Shtylyov
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Catalin Radu @ 2011-02-02 16:41 UTC (permalink / raw)
To: u-boot
---
lib/gunzip.c | 16 ++++++++++------
1 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/lib/gunzip.c b/lib/gunzip.c
index 482a476..18cb45b 100644
--- a/lib/gunzip.c
+++ b/lib/gunzip.c
@@ -106,12 +106,16 @@ int zunzip(void *dst, int dstlen, unsigned char *src, unsigned long *lenp,
s.avail_in = *lenp - offset;
s.next_out = dst;
s.avail_out = dstlen;
- r = inflate(&s, Z_FINISH);
- if ((r != Z_STREAM_END) && (stoponerr==1)) {
- printf ("Error: inflate() returned %d\n", r);
- inflateEnd(&s);
- return (-1);
- }
+ do {
+ r = inflate(&s, Z_FINISH);
+ if ((r != Z_STREAM_END) && (r != Z_BUF_ERROR) && (stoponerr==1)) {
+ printf ("Error: inflate() returned %d\n", r);
+ inflateEnd(&s);
+ return (-1);
+ }
+ s.avail_in = *lenp - offset - (int)(s.next_out - (unsigned char*)dst);
+ s.avail_out = dstlen;
+ } while (r == Z_BUF_ERROR);
*lenp = s.next_out - (unsigned char *) dst;
inflateEnd(&s);
--
1.6.3.3
^ permalink raw reply related [flat|nested] 5+ messages in thread* [U-Boot] [PATCH] Fix gunzip to work for any gzipped uImage size Signed-off-by: Catalin Radu <Catalin@VirtualMetrix.com>
2011-02-02 16:41 [U-Boot] [PATCH] Fix gunzip to work for any gzipped uImage size Signed-off-by: Catalin Radu <Catalin@VirtualMetrix.com> Catalin Radu
@ 2011-02-03 12:57 ` Sergei Shtylyov
2011-02-03 12:57 ` Sergei Shtylyov
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Sergei Shtylyov @ 2011-02-03 12:57 UTC (permalink / raw)
To: u-boot
Hello.
On 02-02-2011 19:41, Catalin Radu wrote:
> diff --git a/lib/gunzip.c b/lib/gunzip.c
> index 482a476..18cb45b 100644
> --- a/lib/gunzip.c
> +++ b/lib/gunzip.c
> @@ -106,12 +106,16 @@ int zunzip(void *dst, int dstlen, unsigned char *src, unsigned long *lenp,
> s.avail_in = *lenp - offset;
> s.next_out = dst;
> s.avail_out = dstlen;
> - r = inflate(&s, Z_FINISH);
> - if ((r != Z_STREAM_END)&& (stoponerr==1)) {
> - printf ("Error: inflate() returned %d\n", r);
> - inflateEnd(&s);
> - return (-1);
> - }
> + do {
> + r = inflate(&s, Z_FINISH);
> + if ((r != Z_STREAM_END)&& (r != Z_BUF_ERROR)&& (stoponerr==1)) {
> + printf ("Error: inflate() returned %d\n", r);
> + inflateEnd(&s);
> + return (-1);
> + }
> + s.avail_in = *lenp - offset - (int)(s.next_out - (unsigned char*)dst);
> + s.avail_out = dstlen;
> + } while (r == Z_BUF_ERROR);
Don't use spaces for indenting, only tabs.
WBR, Sergei
^ permalink raw reply [flat|nested] 5+ messages in thread* [U-Boot] [PATCH] Fix gunzip to work for any gzipped uImage size Signed-off-by: Catalin Radu <Catalin@VirtualMetrix.com>
2011-02-02 16:41 [U-Boot] [PATCH] Fix gunzip to work for any gzipped uImage size Signed-off-by: Catalin Radu <Catalin@VirtualMetrix.com> Catalin Radu
2011-02-03 12:57 ` Sergei Shtylyov
@ 2011-02-03 12:57 ` Sergei Shtylyov
2011-04-12 18:59 ` Wolfgang Denk
2011-04-12 19:01 ` Wolfgang Denk
3 siblings, 0 replies; 5+ messages in thread
From: Sergei Shtylyov @ 2011-02-03 12:57 UTC (permalink / raw)
To: u-boot
Your signoff line got "pasted" to the subject.
WBR, Sergei
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] Fix gunzip to work for any gzipped uImage size Signed-off-by: Catalin Radu <Catalin@VirtualMetrix.com>
2011-02-02 16:41 [U-Boot] [PATCH] Fix gunzip to work for any gzipped uImage size Signed-off-by: Catalin Radu <Catalin@VirtualMetrix.com> Catalin Radu
2011-02-03 12:57 ` Sergei Shtylyov
2011-02-03 12:57 ` Sergei Shtylyov
@ 2011-04-12 18:59 ` Wolfgang Denk
2011-04-12 19:01 ` Wolfgang Denk
3 siblings, 0 replies; 5+ messages in thread
From: Wolfgang Denk @ 2011-04-12 18:59 UTC (permalink / raw)
To: u-boot
Dear Catalin Radu,
In message <1296664907-2185-1-git-send-email-Catalin@VirtualMetrix.com> you wrote:
> ---
> lib/gunzip.c | 16 ++++++++++------
> 1 files changed, 10 insertions(+), 6 deletions(-)
Please resubmit after cleaning up as requested by Sergei!
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Niklaus Wirth has lamented that, whereas Europeans pronounce his name
correctly (Ni-klows Virt), Americans invariably mangle it into
(Nick-les Worth). Which is to say that Europeans call him by name,
but Americans call him by value.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] Fix gunzip to work for any gzipped uImage size Signed-off-by: Catalin Radu <Catalin@VirtualMetrix.com>
2011-02-02 16:41 [U-Boot] [PATCH] Fix gunzip to work for any gzipped uImage size Signed-off-by: Catalin Radu <Catalin@VirtualMetrix.com> Catalin Radu
` (2 preceding siblings ...)
2011-04-12 18:59 ` Wolfgang Denk
@ 2011-04-12 19:01 ` Wolfgang Denk
3 siblings, 0 replies; 5+ messages in thread
From: Wolfgang Denk @ 2011-04-12 19:01 UTC (permalink / raw)
To: u-boot
Dear Catalin Radu,
In message <1296664907-2185-1-git-send-email-Catalin@VirtualMetrix.com> you wrote:
> ---
> lib/gunzip.c | 16 ++++++++++------
> 1 files changed, 10 insertions(+), 6 deletions(-)
Oops. Please ignore me.
Or rather: Next time when posting a follow up patch please make sure
to add proper thread information, and to mark the followup as a
resubmit; see
http://www.denx.de/wiki/view/U-Boot/Patches#Sending_updated_patch_versions
Thanks.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
It is dangerous to be sincere unless you are also stupid.
- George Bernard Shaw
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-04-12 19:01 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-02 16:41 [U-Boot] [PATCH] Fix gunzip to work for any gzipped uImage size Signed-off-by: Catalin Radu <Catalin@VirtualMetrix.com> Catalin Radu
2011-02-03 12:57 ` Sergei Shtylyov
2011-02-03 12:57 ` Sergei Shtylyov
2011-04-12 18:59 ` Wolfgang Denk
2011-04-12 19:01 ` Wolfgang Denk
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox