Skip to content

Commit a85f867

Browse files
author
Valentin Noel
committed
StreamTranscoder: throw an exception if no non-null InputStream is set as input
User should use the StreamTranscoder(IOutputFile&, const ProfileLoader::Profile&) constructor to handle this case.
1 parent 28dc5fe commit a85f867

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/AvTranscoder/transcoder/StreamTranscoder.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,9 @@ StreamTranscoder::StreamTranscoder(const std::vector<InputStreamDesc>& inputStre
165165
}
166166
}
167167

168+
if(_firstInputStreamIndex == std::numeric_limits<size_t>::max())
169+
throw std::runtime_error("Cannot handle empty only input streams");
170+
168171
IInputStream& inputStream = *_inputStreams.at(_firstInputStreamIndex);
169172
const InputStreamDesc& inputStreamDesc = inputStreamsDesc.at(_firstInputStreamIndex);
170173

0 commit comments

Comments
 (0)