Copilot commented on code in PR #3625:
URL: https://github.com/apache/brpc/pull/3625#discussion_r4313682576
##########
src/brpc/rtmp.cpp:
##########
@@ -605,10 +605,12 @@ butil::Status AVCDecoderConfigurationRecord::Create(const
void* data, size_t len
// 5.2.4.1.2 Semantics
// The value of this field shall be one of 0, 1, or 3 corresponding to a
// length encoded with 1, 2, or 4 bytes, respectively.
- length_size_minus1 = buf[4] & 0x03;
- if (length_size_minus1 == 2) {
+ // Reject before storing: AVCNaluIterator CHECKs the stored value, and
+ // TsWriter keeps using its record after a failed Create().
+ if ((buf[4] & 0x03) == 2) {
return butil::Status(EINVAL, "lengthSizeMinusOne should never be 2");
Review Comment:
The error message is slightly ambiguous about the allowed values. Consider
making it explicitly actionable, e.g. mention valid values (0, 1, 3) and that 2
is reserved, so callers can more easily diagnose malformed AVC config records.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]