From 68a401a4639200f246e1adb2987a4de378cdcdff Mon Sep 17 00:00:00 2001 From: gered Date: Tue, 27 Aug 2013 21:25:26 -0400 Subject: [PATCH] don't allow zero length VBO's to be used as a source to copy from --- Blarg.GameFramework/Graphics/VertexBuffer.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Blarg.GameFramework/Graphics/VertexBuffer.cs b/Blarg.GameFramework/Graphics/VertexBuffer.cs index 393c34c..97a1031 100644 --- a/Blarg.GameFramework/Graphics/VertexBuffer.cs +++ b/Blarg.GameFramework/Graphics/VertexBuffer.cs @@ -111,6 +111,8 @@ namespace Blarg.GameFramework.Graphics { if (source == null) throw new ArgumentNullException("source"); + if (source.NumElements <= 0) + throw new InvalidOperationException(); var attributes = new VertexAttributes[source.NumAttributes]; for (int i = 0; i < attributes.Length; ++i)