From 6c8943f9887164c10c7c2f28ec71093a1c179c0f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 30 Aug 2018 20:37:35 +0100 Subject: [PATCH] MMALRender: Protect against divide by zero --- .../cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.h b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.h index a9860f587f1c9..f4f430510df9d 100644 --- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.h +++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.h @@ -58,7 +58,7 @@ class CMMALPool : public IVideoBufferPool static uint32_t TranslateFormat(AVPixelFormat pixfmt); virtual int Width() { return m_width; } virtual int Height() { return m_height; } - virtual int AlignedWidth() { return m_mmal_format == MMAL_ENCODING_YUVUV128 || m_mmal_format == MMAL_ENCODING_YUVUV64_16 ? 0 : m_geo.getStrideY() / m_geo.getBytesPerPixel(); } + virtual int AlignedWidth() { return m_mmal_format == MMAL_ENCODING_YUVUV128 || m_mmal_format == MMAL_ENCODING_YUVUV64_16 || m_geo.getBytesPerPixel() == 0 ? 0 : m_geo.getStrideY() / m_geo.getBytesPerPixel(); } virtual int AlignedHeight() { return m_mmal_format == MMAL_ENCODING_YUVUV128 || m_mmal_format == MMAL_ENCODING_YUVUV64_16 ? 0 : m_geo.getHeightY(); } virtual int BitsPerPixel() { return m_geo.getBitsPerPixel(); } virtual uint32_t &Encoding() { return m_mmal_format; }