diff --git a/README.md b/README.md index b3930d377..52f695c6a 100755 --- a/README.md +++ b/README.md @@ -1287,6 +1287,7 @@ Winlin [bug #515]: https://github.com/ossrs/srs/issues/515 [bug #511]: https://github.com/ossrs/srs/issues/511 [bug #518]: https://github.com/ossrs/srs/issues/518 +[bug #541]: https://github.com/ossrs/srs/issues/541 [bug #xxxxxxxxxx]: https://github.com/ossrs/srs/issues/xxxxxxxxxx [exo #828]: https://github.com/google/ExoPlayer/pull/828 diff --git a/trunk/src/protocol/srs_rtmp_stack.cpp b/trunk/src/protocol/srs_rtmp_stack.cpp index b7771387e..d9eb4ae46 100644 --- a/trunk/src/protocol/srs_rtmp_stack.cpp +++ b/trunk/src/protocol/srs_rtmp_stack.cpp @@ -1514,10 +1514,17 @@ int SrsProtocol::on_recv_message(SrsCommonMessage* msg) { srs_warn("accept chunk size %d, but should in [%d, %d], " "@see: https://github.com/ossrs/srs/issues/160", - pkt->chunk_size, SRS_CONSTS_RTMP_MIN_CHUNK_SIZE, - SRS_CONSTS_RTMP_MAX_CHUNK_SIZE); + pkt->chunk_size, SRS_CONSTS_RTMP_MIN_CHUNK_SIZE, SRS_CONSTS_RTMP_MAX_CHUNK_SIZE); } + // @see: https://github.com/ossrs/srs/issues/541 + if (pkt->chunk_size < SRS_CONSTS_RTMP_MIN_CHUNK_SIZE) { + ret = ERROR_RTMP_CHUNK_SIZE; + srs_error("chunk size should be %d+, value=%d. ret=%d", + SRS_CONSTS_RTMP_MIN_CHUNK_SIZE, pkt->chunk_size, ret); + return ret; + } + in_chunk_size = pkt->chunk_size; srs_trace("input chunk size to %d", pkt->chunk_size);