Skip to content

Commit 0e020f7

Browse files
committed
Added release note
1 parent 71bc177 commit 0e020f7

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

‎RELEASENOTES.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@
6262
* DASH Extension:
6363
* Smooth Streaming Extension:
6464
* RTSP Extension:
65+
* Fix crashing when parsing of RTP packets with header extensions
66+
([#1225](https://github.com/androidx/media/pull/1225)).
6567
* Decoder Extensions (FFmpeg, VP9, AV1, etc.):
6668
* Add the MPEG-H decoder module which uses the native MPEG-H decoder
6769
module to decode MPEG-H audio

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ public static RtpPacket parse(ParsableByteArray packetBuffer) {
205205
byte version = (byte) (firstByte >> 6);
206206
boolean padding = ((firstByte >> 5) & 0x1) == 1;
207207
byte csrcCount = (byte) (firstByte & 0xF);
208-
boolean hasExtension = ((firstByte & 0x10) >> 4) == 1;
208+
boolean hasExtension = ((firstByte >> 4) & 0x1) == 1;
209209

210210
if (version != RTP_VERSION) {
211211
return null;
@@ -236,11 +236,11 @@ public static RtpPacket parse(ParsableByteArray packetBuffer) {
236236

237237
// Extension.
238238
if (hasExtension) {
239-
int headerExtensionProfileData = packetBuffer.readShort();
239+
// Skip profile-defined data
240+
packetBuffer.skipBytes(2);
240241
int headerExtensionPayloadLength = packetBuffer.readShort();
241242
if (headerExtensionPayloadLength != 0) {
242-
byte[] extensionPayload = new byte[headerExtensionPayloadLength * 4];
243-
packetBuffer.readBytes(extensionPayload, 0, headerExtensionPayloadLength * 4);
243+
packetBuffer.skipBytes(headerExtensionPayloadLength * 4);
244244
}
245245
}
246246

0 commit comments

Comments
 (0)