From eb1d1b5cfb474b087d41337356efc0cdb7342f28 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Wed, 2 Sep 2009 14:06:34 -0700 Subject: Fix so that the waterfall texture is initialized with a buffer of the same size. 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gr-wxgui/src/python/plotter/waterfall_plotter.py') diff --git a/gr-wxgui/src/python/plotter/waterfall_plotter.py b/gr-wxgui/src/python/plotter/waterfall_plotter.py index 2e0669961..d32b0ca0a 100644 --- a/gr-wxgui/src/python/plotter/waterfall_plotter.py +++ b/gr-wxgui/src/python/plotter/waterfall_plotter.py @@ -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 -- cgit