---
 plugins/animationaddon/src/particle.cpp |    2 +-
 plugins/decor/src/decor.cpp             |    2 --
 plugins/imgsvg/src/imgsvg.cpp           |    3 ++-
 plugins/wall/src/wall.cpp               |   18 ++++++++++++++----
 4 files changed, 17 insertions(+), 8 deletions(-)

--- a/plugins/decor/src/decor.cpp
+++ b/plugins/decor/src/decor.cpp
@@ -1650,7 +1650,6 @@ DecorWindow::update (bool allowDecoratio
 	    {
 		/* Error condition, reset frame extents */
 		CompWindowExtents emptyExtents;
-		memset (&emptyExtents, 0, sizeof (CompWindowExtents));
 		window->setWindowFrameExtents (&emptyExtents, &emptyExtents);
 		return false;
 	    }
@@ -1681,7 +1680,6 @@ DecorWindow::update (bool allowDecoratio
 
 	/* _NET_FRAME_EXTENTS should be updated before the frame
 	 * atom is */
-	memset (&emptyExtents, 0, sizeof (CompWindowExtents));
 
 	window->setWindowFrameExtents (&emptyExtents, &emptyExtents);
 
--- a/plugins/imgsvg/src/imgsvg.cpp
+++ b/plugins/imgsvg/src/imgsvg.cpp
@@ -327,7 +327,8 @@ SvgWindow::glDraw (const GLMatrix     &t
 		finiTexture (context->texture[1]);
 		initTexture (source, context->texture[1], CompSize ());
 
-		memset (&context->rect, 0, sizeof (BoxRec));
+		CompRect zeroRect;
+		context->rect = zeroRect;
 		context->size.setWidth (0);
 		context->size.setHeight (0);
 	    }
--- a/plugins/wall/src/wall.cpp
+++ b/plugins/wall/src/wall.cpp
@@ -1622,6 +1622,16 @@ WallScreen::matchPropertyChanged (CompWi
     ww->isSliding = !optionGetNoSlideMatch ().evaluate (window);
 }
 
+static void zeroWallCairoContext (WallCairoContext &ctx)
+{
+  ctx.pixmap = 0;
+  ctx.texture = GLTexture::List ();
+  ctx.surface = NULL;
+  ctx.cr = NULL;
+  ctx.width = 0;
+  ctx.height = 0;
+}
+
 WallScreen::WallScreen (CompScreen *screen) :
     PluginClassHandler <WallScreen, CompScreen> (screen),
     WallOptions (),
@@ -1646,10 +1656,10 @@ WallScreen::WallScreen (CompScreen *scre
     // to prevent crashes in XCloseDisplay
     dlopen ("libcairo.so.2", RTLD_LAZY);
 
-    memset (&switcherContext, 0, sizeof (WallCairoContext));
-    memset (&thumbContext, 0, sizeof (WallCairoContext));
-    memset (&highlightContext, 0, sizeof (WallCairoContext));
-    memset (&arrowContext, 0, sizeof (WallCairoContext));
+    zeroWallCairoContext (switcherContext);
+    zeroWallCairoContext (thumbContext);
+    zeroWallCairoContext (highlightContext);
+    zeroWallCairoContext (arrowContext);
     createCairoContexts (true);
 
 #define setAction(action, dir, win) \
--- a/plugins/animationaddon/src/particle.cpp
+++ b/plugins/animationaddon/src/particle.cpp
@@ -117,7 +117,7 @@ ParticleSystem::draw (const GLMatrix &tr
     GLushort *colors = &mColorsCache[0];
 
     int cornersSize = sizeof (GLfloat) * 12;
-    int colorSize = sizeof (GLfloat) * 4;
+    int colorSize = sizeof (GLushort) * 4;
 
     GLfloat cornerCoords[12] = {0.0, 0.0,
 			       0.0, 1.0,
