Hello all,

I've been narrowing down the problem with the sqlite_decode_binary and I've got this 
simplest code:

----8<----
unsigned char out[15000];
memcpy((BYTE*)&out,mybuf,photo_length);
out[photo_length]='\0';
int size=sqlite_decode_binary(out,out);
if(size<0)
{
  // now we don't even get here
}
----8<----

Before I had dynamic memory allocation and it overwrote past the boundary sometimes, 
but wasn't fatal. Now I've got a static array and it simply (and silently) throws me 
out of the program back to Windows. It never gets to the size<0 part or further, so I 
assume that the problem is still inside the sqlite_decode_binary code somewhere. The 
"mybuf" array is valid and is read from the database along with the "photo_length", I 
do checks when the user adds (and sqlite_encode_binary() runs), and there're no errors 
there, so I assume the data is correct and it's size is also correct. The average data 
size is around 3-4K, never over 4.5K, so 15K is more than enough. Or am I missing 
something important?

Any ideas?

TIA

   Dennis

Reply via email to