From 8880867a950f78292f8cf4b37771b08dd0376074 Mon Sep 17 00:00:00 2001 From: Konstantin Date: Fri, 20 Jan 2023 13:31:49 +0100 Subject: Minor, error handling --- Whisper/MF/PcmReader.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Whisper/MF/PcmReader.cpp') diff --git a/Whisper/MF/PcmReader.cpp b/Whisper/MF/PcmReader.cpp index 16f38c6..fa39191 100644 --- a/Whisper/MF/PcmReader.cpp +++ b/Whisper/MF/PcmReader.cpp @@ -1,6 +1,7 @@ #include "stdafx.h" #include "PcmReader.h" #include +#include #include "mfUtils.h" namespace Whisper @@ -130,6 +131,12 @@ namespace { CComPtr mft; HRESULT hr = readerEx->GetTransformForStream( stream, i, &category, &mft ); + if( hr == MF_E_INVALIDINDEX ) + { + // This happens for *.wav input files + // They don't have any MFT_CATEGORY_AUDIO_DECODER MFTs in the source reader, and it's not an error + return S_FALSE; + } if( FAILED( hr ) ) return hr; const __m128i cat = _mm_load_si128( ( const __m128i* ) & category ); -- cgit v1.2.3