1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

fix bug of buffer assert, erase can accept any value

This commit is contained in:
winlin 2014-06-10 16:06:18 +08:00
parent d48d739fa7
commit a639eb0596
4 changed files with 29 additions and 12 deletions

View file

@ -58,7 +58,9 @@ char* SrsBuffer::bytes()
void SrsBuffer::erase(int size)
{
srs_assert(size > 0);
if (size <= 0) {
return;
}
if (size >= length()) {
data.clear();

View file

@ -71,7 +71,7 @@ public:
* erase size of bytes from begin.
* @param size to erase size of bytes.
* clear if size greater than or equals to length()
* @remark assert size is positive.
* @remark ignore size is not positive.
*/
virtual void erase(int size);
/**