Skip to content

Commit

Permalink
fixed crash if audio decoder for some reason doesn't return a frame
Browse files Browse the repository at this point in the history
  • Loading branch information
elupus committed Apr 1, 2012
1 parent a0fc63d commit cfb1bd2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.cpp
Expand Up @@ -149,7 +149,11 @@ int CDVDAudioCodecFFmpeg::Decode(BYTE* pData, int iSize)
, &got_frame
, &avpkt);
if (iBytesUsed < 0 || !got_frame)
{
m_iBufferSize1 = 0;
m_iBufferSize2 = 0;
return iBytesUsed;
}
m_iBufferSize1 = m_dllAvUtil.av_samples_get_buffer_size(NULL, m_pCodecContext->channels, m_pFrame1->nb_samples, m_pCodecContext->sample_fmt, 1);

/* some codecs will attempt to consume more data than what we gave */
Expand Down

0 comments on commit cfb1bd2

Please sign in to comment.