mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
GB28181: Fix memory overlap for small packets. v5.0.111 (#3315)
This commit is contained in:
parent
a36cb57949
commit
56040cab42
3 changed files with 5 additions and 3 deletions
|
@ -1444,8 +1444,9 @@ srs_error_t SrsLazyGbMediaTcpConn::do_cycle()
|
|||
string bytes = srs_string_dumps_hex(b.head(), reserved, 16);
|
||||
srs_trace("PS: Reserved bytes for next loop, pos=%d, left=%d, total=%d, bytes=[%s]",
|
||||
b.pos(), b.left(), b.size(), bytes.c_str());
|
||||
// Copy the bytes left to the start of buffer.
|
||||
b.read_bytes((char*)buffer_, reserved);
|
||||
// Copy the bytes left to the start of buffer. Note that the left(reserved) bytes might be overlapped with
|
||||
// buffer, so we must use memmove not memcpy, see https://github.com/ossrs/srs/issues/3300#issuecomment-1352907075
|
||||
memmove(buffer_, b.head(), reserved);
|
||||
pack_->media_reserved_++;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,6 +9,6 @@
|
|||
|
||||
#define VERSION_MAJOR 5
|
||||
#define VERSION_MINOR 0
|
||||
#define VERSION_REVISION 110
|
||||
#define VERSION_REVISION 111
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue