From 81e50d0c782cc18eab4ef40ecd6c7f36df50fea5 Mon Sep 17 00:00:00 2001 From: Wei Jia Date: Thu, 24 Jul 2014 10:28:47 -0700 Subject: Reset the value for Vector of pointers. Bug: 16467066 Change-Id: I3674e07779a59f4d4fa639d066ed1988df89b3f5 --- media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'media/libmediaplayerservice') diff --git a/media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp b/media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp index 1b9bafb..8fce2f4 100644 --- a/media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp +++ b/media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp @@ -155,8 +155,14 @@ void NuPlayer::Decoder::releaseAndResetMediaBuffers() { } } mMediaBuffers.resize(mInputBuffers.size()); + for (size_t i = 0; i < mMediaBuffers.size(); i++) { + mMediaBuffers.editItemAt(i) = NULL; + } mInputBufferIsDequeued.clear(); mInputBufferIsDequeued.resize(mInputBuffers.size()); + for (size_t i = 0; i < mInputBufferIsDequeued.size(); i++) { + mInputBufferIsDequeued.editItemAt(i) = false; + } } void NuPlayer::Decoder::requestCodecNotification() { -- cgit v1.1