sahvx655-wq commented on code in PR #3625:
URL: https://github.com/apache/brpc/pull/3625#discussion_r4322587088
##########
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:
That message is the existing upstream wording, the patch only moves the
check ahead of the assignment. I'd rather leave the text alone here so the diff
stays limited to the stale-state fix; the comment block directly above already
spells out that 0, 1 and 3 are the valid values.
--
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]