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:
authorUnderground78 <underground78@users.sourceforge.net>2014-11-11 02:30:44 +0300
committerHendrik Leppkes <h.leppkes@gmail.com>2014-11-28 16:40:53 +0300
commit95088c189bca63ad104c305b8c2c1e03ac158ea6 (patch)
tree5b651b82b8864a5ef9cfb79ff14446038e2630bb /decoder
parent55fa5ba3cff8e9dd6820a1ff537465e78a0b318a (diff)
DXVA2 decoder: Don't crash when the width or height cannot be determined.
In that case, just refuse to decode using DXVA.
Diffstat (limited to 'decoder')
-rw-r--r--decoder/LAVVideo/decoders/dxva2dec.cpp3
1 files changed, 3 insertions, 0 deletions
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));