Fixed some bugs when receiving large data.

This commit is contained in:
t-moe
2015-04-25 14:05:44 +02:00
parent 3d1e4b2ef2
commit 0858b0d2cb
8 changed files with 55 additions and 19 deletions

View File

@@ -856,6 +856,10 @@ int Chirp::realloc(uint32_t min)
min = m_bufSize+CRP_BUFSIZE;
else
min += CRP_BUFSIZE;
if(min==m_bufSize)
return CRP_RES_OK;
uint8_t *newbuf = new (std::nothrow) uint8_t[min];
if (newbuf==NULL)
return CRP_RES_ERROR_MEMORY;