@@ -122,8 +122,15 @@ class FastPFor : public IntegerCODEC {
122122 in += thissize;
123123 }
124124 assert (out == nvalue + initout);
125- if (oldnvalue < nvalue)
126- std::cerr << " It is possible we have a buffer overrun. " << std::endl;
125+ if (oldnvalue < nvalue)
126+ std::cerr
127+ << " It is possible we have a buffer overrun. You reported having allocated "
128+ << oldnvalue * sizeof (uint32_t )
129+ << " bytes for the compressed data but we needed "
130+ << nvalue * sizeof (uint32_t )
131+ << " bytes. Please increase the available memory"
132+ " for compressed data or check the value of the last parameter provided "
133+ " to the encodeArray method." << std::endl;
127134 resetBuffer (); // if you don't do this, the buffer has a memory
128135 }
129136
@@ -346,8 +353,15 @@ class SimplePFor : public IntegerCODEC {
346353 in += thissize;
347354 }
348355 assert (out == nvalue + initout);
349- if (oldnvalue < nvalue)
350- std::cerr << " It is possible we have a buffer overrun. " << std::endl;
356+ if (oldnvalue < nvalue)
357+ std::cerr
358+ << " It is possible we have a buffer overrun. You reported having allocated "
359+ << oldnvalue * sizeof (uint32_t )
360+ << " bytes for the compressed data but we needed "
361+ << nvalue * sizeof (uint32_t )
362+ << " bytes. Please increase the available memory"
363+ " for compressed data or check the value of the last parameter provided "
364+ " to the encodeArray method." << std::endl;
351365 }
352366
353367 void getBestBFromData (const uint32_t *in, uint8_t &bestb,
0 commit comments