From: Josh Blum Date: Wed, 2 Sep 2009 21:06:34 +0000 (-0700) Subject: Fix so that the waterfall texture is initialized with a buffer of the same size. X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=eb1d1b5cfb474b087d41337356efc0cdb7342f28;p=debian%2Fgnuradio 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. --- diff --git a/gr-wxgui/src/python/plotter/waterfall_plotter.py b/gr-wxgui/src/python/plotter/waterfall_plotter.py index 2e066996..d32b0ca0 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