Skip to content

Commit 193c126

Browse files
committed
[WIC] Fix issue sharpdx#418. Index out of range when reading a byte[0] from a MetadatqQueryReader
1 parent e099624 commit 193c126

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Source/SharpDX/Win32/Variant.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,10 @@ public unsafe object Value
9191
case VariantElementType.Blob:
9292
{
9393
var buffer = new byte[(int)variantValue.recordValue.RecordInfo];
94-
Utilities.Read(variantValue.recordValue.RecordPointer, buffer, 0, buffer.Length);
94+
if (buffer.Length > 0)
95+
{
96+
Utilities.Read(variantValue.recordValue.RecordPointer, buffer, 0, buffer.Length);
97+
}
9598
return buffer;
9699
}
97100
case VariantElementType.Bool:

0 commit comments

Comments
 (0)