mmalrender: Reject unsupported render formats
authorpopcornmix <popcornmix@gmail.com>
Fri, 8 Jan 2016 13:37:03 +0000 (13:37 +0000)
committerpopcornmix <popcornmix@gmail.com>
Tue, 2 Feb 2016 13:24:19 +0000 (13:24 +0000)
Avoids a crash when 10-bit video is played

xbmc/cores/VideoRenderers/MMALRenderer.cpp

index 466f44c..2941d34 100644 (file)
@@ -286,6 +286,11 @@ bool CMMALRenderer::Configure(unsigned int width, unsigned int height, unsigned
   m_iFlags = flags;
 
   CLog::Log(LOGDEBUG, "%s::%s - %dx%d->%dx%d@%.2f flags:%x format:%d ext:%x orient:%d", CLASSNAME, __func__, width, height, d_width, d_height, fps, flags, format, extended_format, orientation);
+  if (format != RENDER_FMT_YUV420P && format != RENDER_FMT_BYPASS && format != RENDER_FMT_MMAL)
+  {
+    CLog::Log(LOGERROR, "%s::%s - format:%d not supported", CLASSNAME, __func__, format);
+    return false;
+  }
 
   m_RenderUpdateCallBackFn = NULL;
   m_RenderUpdateCallBackCtx = NULL;