Do not send uninitialized memory as a texture.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Wed, 3 Oct 2012 12:40:13 +0000 (14:40 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Wed, 3 Oct 2012 12:40:13 +0000 (14:40 +0200)
effect_chain.cpp

index 19c485c..0985ee4 100644 (file)
@@ -221,6 +221,7 @@ void EffectChain::finalize()
                glGenTextures(num_textures, temp_textures);
 
                unsigned char *empty = new unsigned char[width * height * 4];
+               memset(empty, 0, width * height * 4);
                for (unsigned i = 0; i < num_textures; ++i) {
                        glBindTexture(GL_TEXTURE_2D, temp_textures[i]);
                        check_error();