This is an automated email from the ASF dual-hosted git repository.

chenBright pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brpc.git


The following commit(s) were added to refs/heads/master by this push:
     new 7b8b85bb Bound exp-golomb suffix read to bitstream in 
avc_nalu_read_uev (#3334)
7b8b85bb is described below

commit 7b8b85bb53caeb337adf263b980a520893c65221
Author: sahvx655-wq <[email protected]>
AuthorDate: Sun Jun 14 10:05:49 2026 +0530

    Bound exp-golomb suffix read to bitstream in avc_nalu_read_uev (#3334)
---
 src/brpc/details/rtmp_utils.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/brpc/details/rtmp_utils.cpp b/src/brpc/details/rtmp_utils.cpp
index ea376368..396dd945 100644
--- a/src/brpc/details/rtmp_utils.cpp
+++ b/src/brpc/details/rtmp_utils.cpp
@@ -42,6 +42,9 @@ int avc_nalu_read_uev(BitStream* stream, int32_t* v) {
     }
     int32_t result = (1 << leadingZeroBits) - 1;
     for (int i = 0; i < leadingZeroBits; i++) {
+        if (stream->empty()) {
+            return -1;
+        }
         int32_t b = stream->read_bit();
         result += b << (leadingZeroBits - 1);
     }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to