diff options
author | James Dong <jdong@google.com> | 2012-05-21 13:38:42 -0700 |
---|---|---|
committer | James Dong <jdong@google.com> | 2012-05-21 13:48:20 -0700 |
commit | 21a0dca457bc0f3b8bafca0c49dfe2d442acbde0 (patch) | |
tree | 07bd56fc5b179e0cd3b83fdc6bda50995046818e /media | |
parent | bf2461ecc71c0aacf8c03fcdaf0dc46bc8285c7f (diff) | |
download | frameworks_av-21a0dca457bc0f3b8bafca0c49dfe2d442acbde0.zip frameworks_av-21a0dca457bc0f3b8bafca0c49dfe2d442acbde0.tar.gz frameworks_av-21a0dca457bc0f3b8bafca0c49dfe2d442acbde0.tar.bz2 |
Fix a mediaserver crash caused by dereferencing a NULL pointer.
The pointer (info in method drainInputBuffer) in can be null at the point of the dereference,
but it will get updated subsequently. Thus, we should move the logging after the pointer gets updated.
related-to-bug: 6530159
Change-Id: Ifa5f19a694953af6942454e5c28cd3fa024f11d2
Diffstat (limited to 'media')
-rwxr-xr-x | media/libstagefright/OMXCodec.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/media/libstagefright/OMXCodec.cpp b/media/libstagefright/OMXCodec.cpp index ba8dd57..66111dc 100755 --- a/media/libstagefright/OMXCodec.cpp +++ b/media/libstagefright/OMXCodec.cpp @@ -3148,11 +3148,6 @@ bool OMXCodec::drainInputBuffer(BufferInfo *info) { mNoMoreOutputData = false; } - CODEC_LOGV("Calling emptyBuffer on buffer %p (length %d), " - "timestamp %lld us (%.2f secs)", - info->mBuffer, offset, - timestampUs, timestampUs / 1E6); - if (info == NULL) { CHECK(mFlags & kUseSecureInputBuffers); CHECK(signalEOS); @@ -3163,6 +3158,11 @@ bool OMXCodec::drainInputBuffer(BufferInfo *info) { info = findEmptyInputBuffer(); } + CODEC_LOGV("Calling emptyBuffer on buffer %p (length %d), " + "timestamp %lld us (%.2f secs)", + info->mBuffer, offset, + timestampUs, timestampUs / 1E6); + err = mOMX->emptyBuffer( mNode, info->mBuffer, 0, offset, flags, timestampUs); |