]> wimlib.net Git - wimlib/blobdiff - src/resource.c
streamifier_cb(): Adjust cur_stream_offset even if ->consume_chunk() fails
[wimlib] / src / resource.c
index ea2ff5fec573a4b4f5f7630e9db4c24cf0dcb174..7631dd492309283bb7d8fa72a569004f64ae619d 100644 (file)
@@ -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.  */