diff options
author | Hendrik Leppkes <h.leppkes@gmail.com> | 2013-02-27 22:31:18 +0400 |
---|---|---|
committer | Hendrik Leppkes <h.leppkes@gmail.com> | 2013-02-27 22:31:18 +0400 |
commit | 045c141e03c089a7242cc6318639e72fa85aac1f (patch) | |
tree | 1373f7e31df97226cffbf1598d643af2b33aedee /decoder | |
parent | 3fabc5a3e7e2c0e9ec65f8156c77a38f974845bb (diff) |
Avoid crashes on incomplete media types.
Fixes issue 334.
Diffstat (limited to 'decoder')
-rw-r--r-- | decoder/LAVVideo/LAVVideo.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/decoder/LAVVideo/LAVVideo.cpp b/decoder/LAVVideo/LAVVideo.cpp index 8d1faa98..97c6dccf 100644 --- a/decoder/LAVVideo/LAVVideo.cpp +++ b/decoder/LAVVideo/LAVVideo.cpp @@ -523,12 +523,12 @@ HRESULT CLAVVideo::DecideBufferSize(IMemAllocator* pAllocator, ALLOCATOR_PROPERT } BITMAPINFOHEADER *pBIH = NULL; - CMediaType mtOut = m_pOutput->CurrentMediaType(); - videoFormatTypeHandler(mtOut.Format(), mtOut.FormatType(), &pBIH, NULL); + CMediaType &mtOut = m_pOutput->CurrentMediaType(); + videoFormatTypeHandler(mtOut, &pBIH); long downstreamBuffers = pProperties->cBuffers; pProperties->cBuffers = max(pProperties->cBuffers, 2) + m_Decoder.GetBufferCount(); - pProperties->cbBuffer = pBIH->biSizeImage; + pProperties->cbBuffer = pBIH ? pBIH->biSizeImage : 3110400; pProperties->cbAlign = 1; pProperties->cbPrefix = 0; |