Skip to content

Commit 68d2c66

Browse files
Minor adjustments
Got read of endOfData variable in favor of check based on bytesLeft
1 parent c2f4c24 commit 68d2c66

File tree

1 file changed

+1
-2
lines changed
  • libraries/exoplayer_rtsp/src/main/java/androidx/media3/exoplayer/rtsp/reader

1 file changed

+1
-2
lines changed

‎libraries/exoplayer_rtsp/src/main/java/androidx/media3/exoplayer/rtsp/reader/RtpH265Reader.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,12 +203,11 @@ private void processAggregationPacket(ParsableByteArray data)
203203

204204
// Since sprop-max-don-diff != 0 is not supported, DONL won't present in the packet.
205205

206-
int endOfData = data.bytesLeft();
207206
data.setPosition(2); // skipping payload header (2 bytes)
208207
do {
209208
short nalUnitSize = data.readShort(); // 2 bytes of NAL unit size
210209
int nalHeaderType = (data.getData()[data.getPosition()] >> 1) & 0x3F;
211-
if (data.getPosition() + nalUnitSize > endOfData) {
210+
if (data.bytesLeft() < nalUnitSize) {
212211
throw ParserException.createForMalformedManifest(
213212
"Malformed Aggregation Packet. NAL unit size exceeds packet size.",
214213
/* cause= */ null

0 commit comments

Comments
 (0)