DivestOS/Patches/LineageOS-20.0/ASB-2023-10/av-05.patch
Tad af360bc9ea
20.0: October ASB picks
wget c873988898.patch -O telecomm-01.patch
wget 0fb5786dbf.patch -O mediaprovider-01.patch
wget 1a4b9ef510.patch -O wifi-01.patch
wget 364a1d9962.patch -O bluetooth-01.patch
wget 87a06448b9.patch -O settings-01.patch
wget aaba724a68.patch -O settings-02.patch
wget 507304e1f5.patch -O native-01.patch
wget 89489ff5dd.patch -O base-01.patch
wget d1765c4715.patch -O base-02.patch
wget cbb1a0ecd6.patch -O base-03.patch
wget 4725772c0b.patch -O base-04.patch
wget 19747f6923.patch -O base-05.patch
wget e7a1aa9ed0.patch -O base-06.patch
wget 922a7860b1.patch -O base-07.patch
wget ed183ed912.patch -O base-08.patch
wget c6fbe1330a.patch -O base-09.patch
wget 9141cac175.patch -O base-10.patch
wget 41235bcc67.patch -O av-01.patch
wget a89f704701.patch -O av-02.patch
wget 6d7cd80d77.patch -O av-03.patch
wget 75fc175a08.patch -O av-04.patch
wget b023ec300f.patch -O av-05.patch
wget c8117d1539.patch -O av-06.patch
wget f06d23d824.patch -O av-07.patch
wget 9c7408ab07.patch -O av-08.patch
wget cfbfcefb3c.patch -O launcher-01.patch
wget 4a27a7f162.patch -O libxml-01.patch

Signed-off-by: Tad <tad@spotco.us>
2023-10-03 14:42:00 -04:00

34 lines
1.3 KiB
Diff

From b023ec300f437494d6d6b23b03607e308dae43d2 Mon Sep 17 00:00:00 2001
From: Jiajia Cong <jcong@codeaurora.org>
Date: Wed, 2 Dec 2020 12:00:49 +0800
Subject: [PATCH] codec2: fix issue in allocating too many 8k buffers
default output delay is too large, in 8k use case, framework doesn't
allow to use so much memory to allocate those 8k buffers.
if exceeds max capacity and underlying buffer alloc fail. do not
create MediaCodecBuffer holds a null underlying ABuffer. Otherwise,
some MediaCodecBuffer APIs may access ABuffer (nullptr).
Bug: b/208481412
Change-Id: Ic8e33f6c27ee1c435bf0dc4bc09df87cb0ad3c3a
---
media/codec2/sfplugin/Codec2Buffer.cpp | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/media/codec2/sfplugin/Codec2Buffer.cpp b/media/codec2/sfplugin/Codec2Buffer.cpp
index 55e0c45fad..876c96d484 100644
--- a/media/codec2/sfplugin/Codec2Buffer.cpp
+++ b/media/codec2/sfplugin/Codec2Buffer.cpp
@@ -843,6 +843,10 @@ sp<ConstGraphicBlockBuffer> ConstGraphicBlockBuffer::AllocateEmpty(
}
}
sp<ABuffer> aBuffer(alloc(align(width, 16) * align(height, 16) * bpp / 8));
+ if (aBuffer == nullptr) {
+ ALOGD("%s: failed to allocate buffer", __func__);
+ return nullptr;
+ }
return new ConstGraphicBlockBuffer(
format,
aBuffer,