Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/LAVFilters.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2015-03-03 18:58:42 +0300
committerHendrik Leppkes <h.leppkes@gmail.com>2015-03-03 18:58:42 +0300
commit33e64c83ff1ccbe030ae3a3e9467a5cc4737b480 (patch)
tree897782bfa8207076fae155fbd2ffaa869f31e863 /decoder
parent5aab6666e69fc76428f0a1375eda6c5261005970 (diff)
Make GetDecodeDetails a bit more resilient
Diffstat (limited to 'decoder')
-rw-r--r--decoder/LAVAudio/LAVAudio.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/decoder/LAVAudio/LAVAudio.cpp b/decoder/LAVAudio/LAVAudio.cpp
index e3009e8d..59cda835 100644
--- a/decoder/LAVAudio/LAVAudio.cpp
+++ b/decoder/LAVAudio/LAVAudio.cpp
@@ -791,7 +791,7 @@ BOOL CLAVAudio::IsSampleFormatSupported(LAVAudioSampleFormat sfCheck)
HRESULT CLAVAudio::GetDecodeDetails(const char **pCodec, const char **pDecodeFormat, int *pnChannels, int *pSampleRate, DWORD *pChannelMask)
{
- if(!m_pInput || m_pInput->IsConnected() == FALSE) {
+ if(!m_pInput || m_pInput->IsConnected() == FALSE || !m_pAVCtx) {
return E_UNEXPECTED;
}
if (m_avBSContext) {
@@ -818,7 +818,7 @@ HRESULT CLAVAudio::GetDecodeDetails(const char **pCodec, const char **pDecodeFor
"dts", nullptr, "dts-es", "dts 96/24", nullptr, "dts-hd hra", "dts-hd ma", "dts express"
};
- int index = 0, profile = m_pAVCtx->profile;
+ int index = 0, profile = m_pAVCtx ? m_pAVCtx->profile : FF_PROFILE_UNKNOWN;
if (profile != FF_PROFILE_UNKNOWN)
while(profile >>= 1) index++;
if (index > 7) index = 0;