From cf8f7cc674a51321fb09b0d9ad23904a10c2d8d2 Mon Sep 17 00:00:00 2001 From: Malte Rosenbjerg Date: Wed, 4 Dec 2024 21:29:37 +0200 Subject: [PATCH] Call MoveNext before accessing Current --- FFMpegCore/FFMpeg/Pipes/RawAudioPipeSource.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FFMpegCore/FFMpeg/Pipes/RawAudioPipeSource.cs b/FFMpegCore/FFMpeg/Pipes/RawAudioPipeSource.cs index 653e252..cfe31ef 100644 --- a/FFMpegCore/FFMpeg/Pipes/RawAudioPipeSource.cs +++ b/FFMpegCore/FFMpeg/Pipes/RawAudioPipeSource.cs @@ -27,7 +27,7 @@ public string GetStreamArguments() public async Task WriteAsync(Stream outputStream, CancellationToken cancellationToken) { - if (_sampleEnumerator.Current != null) + if (_sampleEnumerator.MoveNext() && _sampleEnumerator.Current != null) { await _sampleEnumerator.Current.SerializeAsync(outputStream, cancellationToken).ConfigureAwait(false); }