1
0
Fork 0
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:
Winlin 2022-12-17 15:05:10 +08:00 committed by GitHub
parent a36cb57949
commit 56040cab42
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 3 deletions

View file

@ -8,6 +8,7 @@ The changelog for SRS.
## SRS 5.0 Changelog
* v5.0, 2022-12-15, For [#3300](https://github.com/ossrs/srs/issues/3300): GB28181: Fix memory overlap for small packets. v5.0.111
* v5.0, 2022-12-14, For [#939](https://github.com/ossrs/srs/issues/939): FLV: Support set default has_av and disable guessing. v5.0.110
* v5.0, 2022-12-13, For [#939](https://github.com/ossrs/srs/issues/939): FLV: Drop packet if header flag is not matched. v5.0.109
* v5.0, 2022-12-13, For [#939](https://github.com/ossrs/srs/issues/939): FLV: Reset has_audio or has_video if only sequence header.

View file

@ -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_++;
}
}

View file

@ -9,6 +9,6 @@
#define VERSION_MAJOR 5
#define VERSION_MINOR 0
#define VERSION_REVISION 110
#define VERSION_REVISION 111
#endif