From 23c36522b5ea03ba8a966a71a95b6a2711962137 Mon Sep 17 00:00:00 2001 From: Alexey Vasilyev Date: Wed, 25 Dec 2024 19:41:29 +0200 Subject: [PATCH] Fixed https://github.com/alexeyvasilyev/rtsp-client-android/issues/99 --- build.gradle | 4 ++-- gradle/wrapper/gradle-wrapper.properties | 2 +- library-client-rtsp/build.gradle | 2 +- .../src/main/java/com/alexvas/utils/VideoCodecUtils.kt | 4 ++++ 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index e890320..0e6123c 100644 --- a/build.gradle +++ b/build.gradle @@ -4,8 +4,8 @@ buildscript { ext.compile_sdk_version = 35 ext.min_sdk_version = 24 ext.target_sdk_version = 35 - ext.project_version_code = 532 - ext.project_version_name = '5.3.2' + ext.project_version_code = 533 + ext.project_version_name = '5.3.3' repositories { google() diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index e2847c8..cea7a79 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/library-client-rtsp/build.gradle b/library-client-rtsp/build.gradle index a633d77..8aed433 100644 --- a/library-client-rtsp/build.gradle +++ b/library-client-rtsp/build.gradle @@ -39,7 +39,7 @@ android { dependencies { implementation 'androidx.annotation:annotation:1.9.1' - implementation 'androidx.media3:media3-exoplayer:1.5.0' + implementation 'androidx.media3:media3-exoplayer:1.5.1' implementation 'androidx.camera:camera-core:1.4.1' // YUV -> BMP conversion implementation 'org.jcodec:jcodec:0.2.5' // SPS frame modification } diff --git a/library-client-rtsp/src/main/java/com/alexvas/utils/VideoCodecUtils.kt b/library-client-rtsp/src/main/java/com/alexvas/utils/VideoCodecUtils.kt index 1ffa0ed..876f6dd 100644 --- a/library-client-rtsp/src/main/java/com/alexvas/utils/VideoCodecUtils.kt +++ b/library-client-rtsp/src/main/java/com/alexvas/utils/VideoCodecUtils.kt @@ -101,6 +101,8 @@ object VideoCodecUtils { val nalUnitIndex = searchForNalUnitStart(data, off, length, nalUnitPrefixSize) if (nalUnitIndex >= 0) { val nalUnitOffset = nalUnitIndex + nalUnitPrefixSize.get() + if (nalUnitOffset >= data.size) + break val nalUnitTypeOctet = data[nalUnitOffset] if ((nalUnitTypeOctet and 0x1f).toInt() == byUnitType) { return nalUnitIndex @@ -304,6 +306,8 @@ object VideoCodecUtils { if (nalUnitIndex >= 0) { val nalUnitOffset = nalUnitIndex + nalUnitPrefixSize.get() + if (nalUnitOffset >= data.size) + return false val nalUnitTypeOctet = data[nalUnitOffset] if (isH265) {