Skip to content
This repository was archived by the owner on Mar 30, 2019. It is now read-only.
This repository was archived by the owner on Mar 30, 2019. It is now read-only.

DataStream copy does not account for index offset #785

@tomspilman

Description

@tomspilman

I just noticed what I think is a bug in the DataStream.Create:

https://github.com/sharpdx/SharpDX/blob/master/Source/SharpDX/DataStream.cs#L118

The path that makes a copy of the buffer does not account for the index. It seems like that should be changed to:

else
{
   var indexOffset = index * Utilities.SizeOf<T>();
   stream = new DataStream(Interop.Fixed(userBuffer) + indexOffset, sizeOfBuffer - indexOffset, canRead, canWrite, true);
}

This seem correct or am I missing something?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions