aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBtbN <btbn@btbn.de>2013-07-26 10:34:50 +0200
committerBtbN <btbn@btbn.de>2013-07-26 10:54:03 +0200
commit930071d189499f735b7e5529dde986538ce3dcd9 (patch)
tree8d5d00e1a1194c7c8c1e14425acd56c434b544c7
parent6c0eab9b12e4b0f6896b14a6028e8fa5edb8610c (diff)
VAAPI: Add check for maximum surface count in EnsureSurfaces
-rw-r--r--xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp
index 84452848d6..7951ee7bb1 100644
--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp
+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp
@@ -396,6 +396,12 @@ bool CDecoder::EnsureSurfaces(AVCodecContext *avctx, unsigned n_surfaces_count)
{
CLog::Log(LOGDEBUG, "VAAPI - making sure %d surfaces are allocated for given %d references", n_surfaces_count, avctx->refs);
+ if(n_surfaces_count > m_surfaces_max)
+ {
+ CLog::Log(LOGERROR, "VAAPI - Failed to ensure surfaces! Requested %d surfaces. Maximum possible count is %d!", n_surfaces_count, m_surfaces_max);
+ return false;
+ }
+
if(n_surfaces_count <= m_surfaces_count)
return true;