From 2b691b90507ec45a98636a855c46de5dbe27c84a Mon Sep 17 00:00:00 2001 From: Zbigniew Mazur Date: Thu, 11 Oct 2012 13:56:41 +0200 Subject: AudioTrack::dump null mCblk check test This fix is protecting AudioTrack::dump from SIGSEGEV when calling dumpsys shell command. Change-Id: I30d136e195a12d6fdad41e14f557b0ad9e59b8a2 --- media/libmedia/AudioTrack.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'media') diff --git a/media/libmedia/AudioTrack.cpp b/media/libmedia/AudioTrack.cpp index 362d022..aec8c4a 100644 --- a/media/libmedia/AudioTrack.cpp +++ b/media/libmedia/AudioTrack.cpp @@ -1441,7 +1441,7 @@ status_t AudioTrack::dump(int fd, const Vector& args) const result.append(" AudioTrack::dump\n"); snprintf(buffer, 255, " stream type(%d), left - right volume(%f, %f)\n", mStreamType, mVolume[0], mVolume[1]); result.append(buffer); - snprintf(buffer, 255, " format(%d), channel count(%d), frame count(%d)\n", mFormat, mChannelCount, mCblk->frameCount); + snprintf(buffer, 255, " format(%d), channel count(%d), frame count(%d)\n", mFormat, mChannelCount, (mCblk == 0) ? 0 : mCblk->frameCount); result.append(buffer); snprintf(buffer, 255, " sample rate(%d), status(%d), muted(%d)\n", (mCblk == 0) ? 0 : mCblk->sampleRate, mStatus, mMuted); result.append(buffer); -- cgit v1.1