Error Video Client

Jan 13, 2013 at 8:55 PM

Converter.cs

 

 target[vOffset + ci++] = (byte)((data[xSource0 + 3 + ySource0] + data[xSource0 + 3 + ySource1]) / 2);

 

System.IndexOutOfRangeException was unhandled
  HResult=-2146233080
  Message=Index was outside the bounds of the array.
  Source=ColorSpaceUtils
  StackTrace:
       at ColorSpace.Converter.FromYUY2ToI420(Int32 width, Int32 height, Byte[] data, Int32 offset, Byte[] target, Int32 targetOffset) in d:\Component.Net\NVPX\nvpx-94877\ColorSpaceUtils\Converter.cs:line 109
       at VideoClient.MainWindow.<>c__DisplayClass6.<VideoCapture_NewVideoSample>b__2() in d:\Component.Net\NVPX\nvpx-94877\VideoClient\MainWindow.xaml.cs:line 79
       at VideoClient.MainWindow.EncodeAndSendLastSample(Object state) in d:\Component.Net\NVPX\nvpx-94877\VideoClient\MainWindow.xaml.cs:line 94
       at System.Threading.TimerQueueTimer.CallCallbackInContext(Object state)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.TimerQueueTimer.CallCallback()
       at System.Threading.TimerQueueTimer.Fire()
       at System.Threading.TimerQueue.FireNextTimers()
       at System.Threading.TimerQueue.AppDomainTimerCallback()
  InnerException:

 

 

Iam using Visual Studio 2012, .net 4.5