[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Discuss-gnuradio] `s < d_bufsize' failed.
From: |
Charles Swiger |
Subject: |
Re: [Discuss-gnuradio] `s < d_bufsize' failed. |
Date: |
Mon, 01 May 2006 18:02:29 -0400 |
On Mon, 2006-05-01 at 10:38 -0700, Eric Blossom wrote:
> On Mon, May 01, 2006 at 12:08:57PM -0400, Chuck Swiger wrote:
> > Any general clues what would be causing:
> >
> > python: ./gr_buffer.h:96: unsigned int gr_buffer::index_add(unsigned
> > int, unsigned int): Assertion `s < d_bufsize' failed.
>
> You're probably returning a value from work/general_work that's
> greater than nouput_items. Add an assert to you code.
>
Look like the old code has a flaw:
for (int k = 0; k < noutput_items; k++){
...
out_sample[k] = interp_sample;
...
}
return k;
but modern compilers deallocate the index when the loop
is completed (one web page says), so the fix is to use:
for (int k = 0; k < noutput_items; k++){
...
out_sample[k] = interp_sample;
...
}
return noutput_items;