diff options
author | Andy Hung <hunga@google.com> | 2014-09-18 14:45:57 -0700 |
---|---|---|
committer | Andy Hung <hunga@google.com> | 2014-09-22 10:23:31 -0700 |
commit | dc9f58dc23a86d0635fd8601d1cbc8d47bab0303 (patch) | |
tree | 2ee7470116618537ff6a11e06c6d87421ed24509 /media/libstagefright | |
parent | 2973994af39d55b58728df3dca067594e826ea2a (diff) | |
download | frameworks_av-dc9f58dc23a86d0635fd8601d1cbc8d47bab0303.zip frameworks_av-dc9f58dc23a86d0635fd8601d1cbc8d47bab0303.tar.gz frameworks_av-dc9f58dc23a86d0635fd8601d1cbc8d47bab0303.tar.bz2 |
MediaCodec: Fix deallocated pointer reference when calling reset()
The name pointer argument in MediaCodec::init() was being
implicitly deallocated.
Bug: 17499622
Change-Id: If9409f95674e52d1478f969f77693c4d27ff1ff2
Diffstat (limited to 'media/libstagefright')
-rw-r--r-- | media/libstagefright/MediaCodec.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/media/libstagefright/MediaCodec.cpp b/media/libstagefright/MediaCodec.cpp index 0bfc6e4..6c98c52 100644 --- a/media/libstagefright/MediaCodec.cpp +++ b/media/libstagefright/MediaCodec.cpp @@ -179,7 +179,7 @@ void MediaCodec::PostReplyWithError(int32_t replyID, int32_t err) { response->postReply(replyID); } -status_t MediaCodec::init(const char *name, bool nameIsType, bool encoder) { +status_t MediaCodec::init(const AString &name, bool nameIsType, bool encoder) { // save init parameters for reset mInitName = name; mInitNameIsType = nameIsType; @@ -191,7 +191,7 @@ status_t MediaCodec::init(const char *name, bool nameIsType, bool encoder) { // queue. mCodec = new ACodec; bool needDedicatedLooper = false; - if (nameIsType && !strncasecmp(name, "video/", 6)) { + if (nameIsType && !strncasecmp(name.c_str(), "video/", 6)) { needDedicatedLooper = true; } else { AString tmp = name; @@ -357,7 +357,7 @@ status_t MediaCodec::reset() { mHaveInputSurface = false; if (err == OK) { - err = init(mInitName.c_str(), mInitNameIsType, mInitIsEncoder); + err = init(mInitName, mInitNameIsType, mInitIsEncoder); } return err; } |