Fix: Vocaluxe crashes when _CopyDecodedFrameToBuffer() fails

This commit is contained in:
lukeIam committed 2017-11-04 20:13:19 +01:00
1 parent 79bbcbdccb
commit 52f1b8f546
1 file changed
+12 -1
@@ -429,7 +429,18 @@ namespace Vocaluxe.Lib.Video.Acinerella
private bool _CopyDecodedFrameToBuffer()
{
bool result;
var decoder = (SACDecoder)Marshal.PtrToStructure(_Videodecoder, typeof(SACDecoder));
SACDecoder decoder;
try
{
decoder = (SACDecoder)Marshal.PtrToStructure(_Videodecoder, typeof(SACDecoder));
}
catch (Exception e)
{
CLog.LogError("Couldn't copy the frame to the managed environment.", false, false, e);
return false;
}
if (decoder.Buffer != IntPtr.Zero)
{
_LastDecodedTime = (float)decoder.Timecode;