From 95088c189bca63ad104c305b8c2c1e03ac158ea6 Mon Sep 17 00:00:00 2001 From: Underground78 Date: Tue, 11 Nov 2014 00:30:44 +0100 Subject: DXVA2 decoder: Don't crash when the width or height cannot be determined. In that case, just refuse to decode using DXVA. --- decoder/LAVVideo/decoders/dxva2dec.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'decoder') diff --git a/decoder/LAVVideo/decoders/dxva2dec.cpp b/decoder/LAVVideo/decoders/dxva2dec.cpp index 6183313a..758e492b 100644 --- a/decoder/LAVVideo/decoders/dxva2dec.cpp +++ b/decoder/LAVVideo/decoders/dxva2dec.cpp @@ -691,6 +691,9 @@ done: HRESULT CDecDXVA2::CheckHWCompatConditions(GUID decoderGuid) { + if (m_dwSurfaceWidth == 0 || m_dwSurfaceHeight == 0) + return E_UNEXPECTED; + int width_mbs = m_dwSurfaceWidth / 16; int height_mbs = m_dwSurfaceHeight / 16; int max_ref_frames_dpb41 = min(11, 32768 / (width_mbs * height_mbs)); -- cgit v1.2.3