diff options
author | Mark Adler <madler@alumni.caltech.edu> | 2011-09-09 23:20:42 -0700 |
---|---|---|
committer | Mark Adler <madler@alumni.caltech.edu> | 2011-09-09 23:20:42 -0700 |
commit | a383133c4e7b93113cee912f213cf9502d785fa7 (patch) | |
tree | bb7c39ab38418fcab817accad1e625b3de0c8237 /infblock.c | |
parent | 14763ac7c6c03bca62c39e35c03cf5bfc7728802 (diff) | |
download | zlib-a383133c4e7b93113cee912f213cf9502d785fa7.tar.gz zlib-a383133c4e7b93113cee912f213cf9502d785fa7.tar.bz2 zlib-a383133c4e7b93113cee912f213cf9502d785fa7.zip |
zlib 1.1.4v1.1.4
Diffstat (limited to 'infblock.c')
-rw-r--r-- | infblock.c | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* infblock.c -- interpret and process block types to last block | 1 | /* infblock.c -- interpret and process block types to last block |
2 | * Copyright (C) 1995-1998 Mark Adler | 2 | * Copyright (C) 1995-2002 Mark Adler |
3 | * For conditions of distribution and use, see copyright notice in zlib.h | 3 | * For conditions of distribution and use, see copyright notice in zlib.h |
4 | */ | 4 | */ |
5 | 5 | ||
@@ -249,10 +249,12 @@ int r; | |||
249 | &s->sub.trees.tb, s->hufts, z); | 249 | &s->sub.trees.tb, s->hufts, z); |
250 | if (t != Z_OK) | 250 | if (t != Z_OK) |
251 | { | 251 | { |
252 | ZFREE(z, s->sub.trees.blens); | ||
253 | r = t; | 252 | r = t; |
254 | if (r == Z_DATA_ERROR) | 253 | if (r == Z_DATA_ERROR) |
254 | { | ||
255 | ZFREE(z, s->sub.trees.blens); | ||
255 | s->mode = BAD; | 256 | s->mode = BAD; |
257 | } | ||
256 | LEAVE | 258 | LEAVE |
257 | } | 259 | } |
258 | s->sub.trees.index = 0; | 260 | s->sub.trees.index = 0; |
@@ -313,11 +315,13 @@ int r; | |||
313 | t = inflate_trees_dynamic(257 + (t & 0x1f), 1 + ((t >> 5) & 0x1f), | 315 | t = inflate_trees_dynamic(257 + (t & 0x1f), 1 + ((t >> 5) & 0x1f), |
314 | s->sub.trees.blens, &bl, &bd, &tl, &td, | 316 | s->sub.trees.blens, &bl, &bd, &tl, &td, |
315 | s->hufts, z); | 317 | s->hufts, z); |
316 | ZFREE(z, s->sub.trees.blens); | ||
317 | if (t != Z_OK) | 318 | if (t != Z_OK) |
318 | { | 319 | { |
319 | if (t == (uInt)Z_DATA_ERROR) | 320 | if (t == (uInt)Z_DATA_ERROR) |
321 | { | ||
322 | ZFREE(z, s->sub.trees.blens); | ||
320 | s->mode = BAD; | 323 | s->mode = BAD; |
324 | } | ||
321 | r = t; | 325 | r = t; |
322 | LEAVE | 326 | LEAVE |
323 | } | 327 | } |
@@ -329,6 +333,7 @@ int r; | |||
329 | } | 333 | } |
330 | s->sub.decode.codes = c; | 334 | s->sub.decode.codes = c; |
331 | } | 335 | } |
336 | ZFREE(z, s->sub.trees.blens); | ||
332 | s->mode = CODES; | 337 | s->mode = CODES; |
333 | case CODES: | 338 | case CODES: |
334 | UPDATE | 339 | UPDATE |