mirror of
https://github.com/Divested-Mobile/DivestOS-Build.git
synced 2024-10-01 01:35:54 -04:00
af360bc9ea
wgetc873988898
.patch -O telecomm-01.patch wget0fb5786dbf
.patch -O mediaprovider-01.patch wget1a4b9ef510
.patch -O wifi-01.patch wget364a1d9962
.patch -O bluetooth-01.patch wget87a06448b9
.patch -O settings-01.patch wgetaaba724a68
.patch -O settings-02.patch wget507304e1f5
.patch -O native-01.patch wget89489ff5dd
.patch -O base-01.patch wgetd1765c4715
.patch -O base-02.patch wgetcbb1a0ecd6
.patch -O base-03.patch wget4725772c0b
.patch -O base-04.patch wget19747f6923
.patch -O base-05.patch wgete7a1aa9ed0
.patch -O base-06.patch wget922a7860b1
.patch -O base-07.patch wgeted183ed912
.patch -O base-08.patch wgetc6fbe1330a
.patch -O base-09.patch wget9141cac175
.patch -O base-10.patch wget41235bcc67
.patch -O av-01.patch wgeta89f704701
.patch -O av-02.patch wget6d7cd80d77
.patch -O av-03.patch wget75fc175a08
.patch -O av-04.patch wgetb023ec300f
.patch -O av-05.patch wgetc8117d1539
.patch -O av-06.patch wgetf06d23d824
.patch -O av-07.patch wget9c7408ab07
.patch -O av-08.patch wgetcfbfcefb3c
.patch -O launcher-01.patch wget4a27a7f162
.patch -O libxml-01.patch Signed-off-by: Tad <tad@spotco.us>
50 lines
2.6 KiB
Diff
50 lines
2.6 KiB
Diff
From f06d23d824f60e98299d03f21c0715477666936d Mon Sep 17 00:00:00 2001
|
|
From: Jeffrey Kardatzke <jkardatzke@google.com>
|
|
Date: Tue, 21 Mar 2023 11:38:33 -0700
|
|
Subject: [PATCH] Fix incorrect buffer size in NuPlayer
|
|
|
|
This was discovered from running GTS tests that were failing because the
|
|
DRM implementation was receiving media packets of incorrect sizes for
|
|
decryption. The problem is that it was copying content using the size of
|
|
the underlying MediaBuffer object rather than the range that was set in
|
|
it. That was leading to lots of trailing garbage in media packets.
|
|
Generally this was fine and decoders would ignore them, but recent
|
|
changes in decryption handling for AMD platforms exposed this problem.
|
|
|
|
The fix is very straightforward in that we should be using the
|
|
range_length rather than the size when copying them. This doesn't impact
|
|
non-DRM content as those buffer sizes appear to be correct already based
|
|
on testing.
|
|
|
|
Bug: b:268158584
|
|
Test: gts.MediaPlayerTest#testLLAMA_H264_BASELINE_240P_800_DOWNLOADED_V1_ASYNC
|
|
no longer shows corruption on guybrush and packet sizes now match
|
|
up as expected
|
|
Change-Id: I14eda495fa76621436b212f2bd3ae9f7093137fe
|
|
---
|
|
media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp | 6 +++---
|
|
1 file changed, 3 insertions(+), 3 deletions(-)
|
|
|
|
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp b/media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp
|
|
index 52b2041ea8..8da09c434a 100644
|
|
--- a/media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp
|
|
+++ b/media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp
|
|
@@ -1104,14 +1104,14 @@ bool NuPlayer::Decoder::onInputBufferFetched(const sp<AMessage> &msg) {
|
|
static_cast<MediaBufferHolder*>(holder.get())->mediaBuffer() : nullptr;
|
|
}
|
|
if (mediaBuf != NULL) {
|
|
- if (mediaBuf->size() > codecBuffer->capacity()) {
|
|
+ if (mediaBuf->range_length() > codecBuffer->capacity()) {
|
|
handleError(ERROR_BUFFER_TOO_SMALL);
|
|
mDequeuedInputBuffers.push_back(bufferIx);
|
|
return false;
|
|
}
|
|
|
|
- codecBuffer->setRange(0, mediaBuf->size());
|
|
- memcpy(codecBuffer->data(), mediaBuf->data(), mediaBuf->size());
|
|
+ codecBuffer->setRange(0, mediaBuf->range_length());
|
|
+ memcpy(codecBuffer->data(), mediaBuf->data(), mediaBuf->range_length());
|
|
|
|
MetaDataBase &meta_data = mediaBuf->meta_data();
|
|
cryptInfo = NuPlayerDrm::getSampleCryptoInfo(meta_data);
|