From: Eric Biggers Date: Wed, 21 May 2014 20:09:13 +0000 (-0500) Subject: streamifier_cb(): Adjust cur_stream_offset even if ->consume_chunk() fails X-Git-Tag: v1.7.0~130 X-Git-Url: https://wimlib.net/git/?p=wimlib;a=commitdiff_plain;h=a0bee8fd4aed91f2ec4da35077dad47582a12a72 streamifier_cb(): Adjust cur_stream_offset even if ->consume_chunk() fails This ensures that ->end_stream() gets called. --- diff --git a/src/resource.c b/src/resource.c index ea2ff5fe..7631dd49 100644 --- a/src/resource.c +++ b/src/resource.c @@ -1002,9 +1002,9 @@ streamifier_cb(const void *chunk, size_t size, void *_ctx) /* Consume the chunk. */ ret = (*ctx->cbs.consume_chunk)(chunk, size, ctx->cbs.consume_chunk_ctx); + ctx->cur_stream_offset += size; if (ret) return ret; - ctx->cur_stream_offset += size; if (ctx->cur_stream_offset == ctx->cur_stream->size) { /* Finished reading all the data for a stream. */