summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2013-05-02 14:45:23 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-05-02 14:45:23 -0700
commitbb85e3730002bbbcbe030d888076f43c5185e0a0 (patch)
treeb664c94594e3158ff789a1db8679aa35e0865f1f /media
parent7306d85c513ae41d247d11ad535bdd5c857b3599 (diff)
parent04a840d9a0eea7d0816b6b665aa150649c46974f (diff)
downloadframeworks_av-bb85e3730002bbbcbe030d888076f43c5185e0a0.zip
frameworks_av-bb85e3730002bbbcbe030d888076f43c5185e0a0.tar.gz
frameworks_av-bb85e3730002bbbcbe030d888076f43c5185e0a0.tar.bz2
am f2ae7606: A reference to the psi section data could become invalid if more
* commit 'f2ae760602a948598a168ad43673bfbd9d50fc6b': A reference to the psi section data could become invalid if more
Diffstat (limited to 'media')
-rw-r--r--media/libstagefright/mpeg2ts/ATSParser.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/media/libstagefright/mpeg2ts/ATSParser.cpp b/media/libstagefright/mpeg2ts/ATSParser.cpp
index c12572f..9850a46 100644
--- a/media/libstagefright/mpeg2ts/ATSParser.cpp
+++ b/media/libstagefright/mpeg2ts/ATSParser.cpp
@@ -1059,7 +1059,7 @@ status_t ATSParser::parsePID(
ssize_t sectionIndex = mPSISections.indexOfKey(PID);
if (sectionIndex >= 0) {
- const sp<PSISection> &section = mPSISections.valueAt(sectionIndex);
+ sp<PSISection> section = mPSISections.valueAt(sectionIndex);
if (payload_unit_start_indicator) {
CHECK(section->isEmpty());
@@ -1068,7 +1068,6 @@ status_t ATSParser::parsePID(
br->skipBits(skip * 8);
}
-
CHECK((br->numBitsLeft() % 8) == 0);
status_t err = section->append(br->data(), br->numBitsLeft() / 8);
@@ -1103,10 +1102,13 @@ status_t ATSParser::parsePID(
if (!handled) {
mPSISections.removeItem(PID);
+ section.clear();
}
}
- section->clear();
+ if (section != NULL) {
+ section->clear();
+ }
return OK;
}