From: Eric Biggers Date: Thu, 26 Dec 2013 02:50:54 +0000 (-0600) Subject: streamifier_cb(): Fix update of cur_stream_offset X-Git-Tag: v1.6.0~95 X-Git-Url: https://wimlib.net/git/?p=wimlib;a=commitdiff_plain;h=4f433755e8f9ef79dbb4699430d047f74e338e82 streamifier_cb(): Fix update of cur_stream_offset read_stream_list() expects it to be zeroed to avoid a second call to end_stream(). --- diff --git a/src/resource.c b/src/resource.c index 9061ffb4..192ffb2e 100644 --- a/src/resource.c +++ b/src/resource.c @@ -947,6 +947,8 @@ streamifier_cb(const void *chunk, size_t size, void *_ctx) if (ctx->cur_stream_offset == ctx->cur_stream->size) { /* Finished reading all the data for a stream. */ + ctx->cur_stream_offset = 0; + DEBUG("End stream (size=%"PRIu64").", ctx->cur_stream->size); ret = (*ctx->cbs.end_stream)(ctx->cur_stream, 0, ctx->cbs.end_stream_ctx); @@ -962,7 +964,6 @@ streamifier_cb(const void *chunk, size_t size, void *_ctx) else ctx->next_stream = NULL; } - ctx->cur_stream_offset = 0; } return 0; }