summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/mpeg2ts
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2013-04-29 13:17:50 -0700
committerAndreas Huber <andih@google.com>2013-04-29 13:17:50 -0700
commit4b4bb11b8747adeb2efe56c7df4ab6803dd7db41 (patch)
treec97e348cd1fb5bd6c6f51fc86fed49b57e018064 /media/libstagefright/mpeg2ts
parentc86ef45279185b474bd6af0a7ae407f8ab577f13 (diff)
downloadframeworks_av-4b4bb11b8747adeb2efe56c7df4ab6803dd7db41.zip
frameworks_av-4b4bb11b8747adeb2efe56c7df4ab6803dd7db41.tar.gz
frameworks_av-4b4bb11b8747adeb2efe56c7df4ab6803dd7db41.tar.bz2
A reference to the psi section data could become invalid if more
sections were added to the KeyedVector. Change-Id: I095b5452ccfad89d69fc502fb21ce39495e201c3 related-to-bug: 8754565
Diffstat (limited to 'media/libstagefright/mpeg2ts')
-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;
}