Fix so that the waterfall texture is initialized with a buffer of the same size.
authorJosh Blum <josh@joshknows.com>
Wed, 2 Sep 2009 21:06:34 +0000 (14:06 -0700)
committerJosh Blum <josh@joshknows.com>
Wed, 2 Sep 2009 21:06:34 +0000 (14:06 -0700)
If the fft size was a non power of two, the buffer would be a different size.
This would cause a segfault. Particularly because fft_window was throwing out a bin.

gr-wxgui/src/python/plotter/waterfall_plotter.py

index 2e0669961badf81da5e6494186746600bc47145a..d32b0ca0a631f07935c78654d70337bbf4e02328 100644 (file)
@@ -209,7 +209,7 @@ class waterfall_plotter(grid_plotter_base):
                self._pointer = 0
                if self._num_lines and self._fft_size:
                        GL.glBindTexture(GL.GL_TEXTURE_2D, self._waterfall_texture)
-                       data = numpy.zeros(self._num_lines*self._fft_size*4, numpy.uint8).tostring()
+                       data = numpy.zeros(self._num_lines*ceil_log2(self._fft_size)*4, numpy.uint8).tostring()
                        GL.glTexImage2D(GL.GL_TEXTURE_2D, 0, GL.GL_RGBA, ceil_log2(self._fft_size), self._num_lines, 0, GL.GL_RGBA, GL.GL_UNSIGNED_BYTE, data)
                self._resize_texture_flag = False