Skip to content

Commit

Permalink
MMALRender: Protect against divide by zero
Browse files Browse the repository at this point in the history
  • Loading branch information
popcornmix committed Sep 7, 2018
1 parent b746d45 commit 6c8943f
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -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; }
Expand Down

0 comments on commit 6c8943f

Please sign in to comment.