diff options
author | Hendrik Leppkes <h.leppkes@gmail.com> | 2014-09-26 15:43:59 +0400 |
---|---|---|
committer | Hendrik Leppkes <h.leppkes@gmail.com> | 2014-09-26 15:43:59 +0400 |
commit | 38c543ac8ec376a91f0f313697565d31f02b20b5 (patch) | |
tree | 26bfc5447bf35f74451d7062cb35c8d040eb67bd /decoder | |
parent | f8ec837ec464e6424c95b11ac3982e28e0ec2c0c (diff) |
Another sanity check to avoid crashing on bad renderers
Diffstat (limited to 'decoder')
-rw-r--r-- | decoder/LAVVideo/LAVVideo.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/decoder/LAVVideo/LAVVideo.cpp b/decoder/LAVVideo/LAVVideo.cpp index 8abd20d2..a6e194c9 100644 --- a/decoder/LAVVideo/LAVVideo.cpp +++ b/decoder/LAVVideo/LAVVideo.cpp @@ -849,6 +849,15 @@ HRESULT CLAVVideo::GetDeliveryBuffer(IMediaSample** ppOut, int width, int height DbgLog((LOG_TRACE, 10, L"-> Width changed from %d to %d (target: %d)", pBMIOld->biWidth, pBMINew->biWidth, rcTarget.right)); #endif + if (pBMINew->biWidth < width) { + DbgLog((LOG_TRACE, 10, L" -> Renderer is trying to shrink the output window, failing!")); + (*ppOut)->Release(); + (*ppOut) = nullptr; + DeleteMediaType(pmt); + return E_FAIL; + } + + if (pmt->formattype == FORMAT_VideoInfo2 && outMt.formattype == FORMAT_VideoInfo2 && m_bDXVAExtFormatSupport) { VIDEOINFOHEADER2 *vih2Current = (VIDEOINFOHEADER2 *)outMt.pbFormat; VIDEOINFOHEADER2 *vih2New = (VIDEOINFOHEADER2 *)pmt->pbFormat; |