summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/ACodec.cpp
diff options
context:
space:
mode:
authorDiogo Ferreira <defer@cyngn.com>2015-12-01 15:52:30 +0000
committerSteve Kondik <shade@chemlab.org>2015-12-01 14:00:33 -0800
commit1de1d15673020bc0bfb72dbb8bb95a4ac199acc8 (patch)
treed4db9bf94d17c2e5ad1bbff8ff46f02af56ab773 /media/libstagefright/ACodec.cpp
parentfb3719ce5ab99427b18d0588042234592ded1991 (diff)
downloadframeworks_av-1de1d15673020bc0bfb72dbb8bb95a4ac199acc8.zip
frameworks_av-1de1d15673020bc0bfb72dbb8bb95a4ac199acc8.tar.gz
frameworks_av-1de1d15673020bc0bfb72dbb8bb95a4ac199acc8.tar.bz2
stagefright: handleSetSurface: Don't dereference null graphic buffers
In metadata mode and when buffers are owned by the native window , it is possible that the graphics buffer is null. This is fine since we don't have to attach it to a surface. However, the logging was trying to dereference this graphic buffer which caused media to crash sporadically. This fixes the flakiness in android.media.cts.MediaPlayerTest#testVideoSurfaceResetting Change-Id: I89f30ca1177d7118da5a7b0ffbbb91370f9b54ab
Diffstat (limited to 'media/libstagefright/ACodec.cpp')
-rw-r--r--media/libstagefright/ACodec.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp
index f7cc4cd..54c648c 100644
--- a/media/libstagefright/ACodec.cpp
+++ b/media/libstagefright/ACodec.cpp
@@ -725,7 +725,7 @@ status_t ACodec::handleSetSurface(const sp<Surface> &surface) {
if (storingMetadataInDecodedBuffers()
&& !mLegacyAdaptiveExperiment
&& info.mStatus == BufferInfo::OWNED_BY_NATIVE_WINDOW) {
- ALOGV("skipping buffer %p", info.mGraphicBuffer->getNativeBuffer());
+ ALOGV("skipping buffer %p", info.mGraphicBuffer.get() ? info.mGraphicBuffer->getNativeBuffer() : 0x0);
continue;
}
ALOGV("attaching buffer %p", info.mGraphicBuffer->getNativeBuffer());