mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-30 08:57:00 +02:00
Fix crash on attempt to play audio from video without such stream
This commit is contained in:
parent
ad9750ed3e
commit
a273eb6413
@ -494,7 +494,11 @@ std::pair<std::unique_ptr<ui8 []>, si64> CAudioInstance::extractAudio(const Vide
|
||||
if (!openInput(videoToOpen))
|
||||
return { nullptr, 0};
|
||||
openContext();
|
||||
openCodec(findAudioStream());
|
||||
|
||||
int audioStreamIndex = findAudioStream();
|
||||
if (audioStreamIndex == -1)
|
||||
return { nullptr, 0};
|
||||
openCodec(audioStreamIndex);
|
||||
|
||||
const auto * codecpar = getCodecParameters();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user