diff options
Diffstat (limited to 'epan')
-rw-r--r-- | epan/tvbuff_zlib.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/epan/tvbuff_zlib.c b/epan/tvbuff_zlib.c index 0e6be80d0a..c92a5d506d 100644 --- a/epan/tvbuff_zlib.c +++ b/epan/tvbuff_zlib.c @@ -246,9 +246,6 @@ tvb_uncompress(tvbuff_t *tvb, const int offset, int comprlen) } - inflateReset(strm); - next = c; - strm->next_in = next; if (c - compr > comprlen) { inflateEnd(strm); g_free(strm); @@ -256,7 +253,13 @@ tvb_uncompress(tvbuff_t *tvb, const int offset, int comprlen) g_free(strmbuf); return NULL; } + /* Drop gzip header */ comprlen -= (int) (c - compr); + next = c; + + inflateReset(strm); + strm->next_in = next; + strm->avail_in = comprlen; inflateEnd(strm); inflateInit2(strm, wbits); |