Skip to content

Commit

Permalink
Fix Coverity 700930 and 700931.
Browse files Browse the repository at this point in the history
Ensure all VDPAULayer fields are initialized in the constructors.
  • Loading branch information
stichnot committed Jun 16, 2013
1 parent a1d6641 commit 516bcb1
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion mythtv/libs/libmythui/mythrender_vdpau.cpp
Expand Up @@ -116,7 +116,12 @@ class VDPAUColor
class VDPAULayer
{
public:
VDPAULayer() {}
VDPAULayer()
{
memset(&m_layer, 0, sizeof(m_layer));
memset(&m_src, 0, sizeof(m_src));
memset(&m_dst, 0, sizeof(m_dst));
}
VDPAULayer(uint surface, const QRect *src, const QRect *dst)
{
if (src)
Expand All @@ -126,13 +131,17 @@ class VDPAULayer
m_src.x1 = src->left() + src->width();
m_src.y1 = src->top() + src->height();
}
else
memset(&m_src, 0, sizeof(m_src));
if (dst)
{
m_dst.x0 = dst->left();
m_dst.y0 = dst->top();
m_dst.x1 = dst->left() + dst->width();
m_dst.y1 = dst->top() + dst->height();
}
else
memset(&m_dst, 0, sizeof(m_dst));
m_layer.struct_version = VDP_LAYER_VERSION;
m_layer.source_surface = surface;
m_layer.source_rect = src ? &m_src : NULL;
Expand Down

0 comments on commit 516bcb1

Please sign in to comment.