sharpdx / SharpDX

SharpDX GitHub Repository
http://sharpdx.org
MIT License
1.7k stars 639 forks source link

StackOverflowException in MediaAttributes.Set<T> #1055

Open spellizzari opened 6 years ago

spellizzari commented 6 years ago

With v4.1.0 the MediaAttributes.Set method causes a stack overflow when given a ComObject or a subclass of ComObject: line 280 https://github.com/sharpdx/SharpDX/blob/bdb12ec420d2b6ff32da184453c722380596ceb8/Source/SharpDX.MediaFoundation/MediaAttributes.cs#L280 calls itself.

This is weird because in Visual Studio, if you do Go To Definition on this call to Set() it leads you to Set(..., Variant), which should be the one to call, but if you inspect the SharpDX.MediaFoundation.dll assembly in Just Decompiles then it clearly shows that the method invokes itself (Set{ComObject} is called).

jkoritzinsky commented 6 years ago

This is fixed in master. The fix will be available in the next release of SharpDX.