mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-02 09:02:03 +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))
|
if (!openInput(videoToOpen))
|
||||||
return { nullptr, 0};
|
return { nullptr, 0};
|
||||||
openContext();
|
openContext();
|
||||||
openCodec(findAudioStream());
|
|
||||||
|
int audioStreamIndex = findAudioStream();
|
||||||
|
if (audioStreamIndex == -1)
|
||||||
|
return { nullptr, 0};
|
||||||
|
openCodec(audioStreamIndex);
|
||||||
|
|
||||||
const auto * codecpar = getCodecParameters();
|
const auto * codecpar = getCodecParameters();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user