summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDeva Ramasubramanian <dramasub@codeaurora.org>2010-11-09 11:47:10 -0800
committerSteve Kondik <shade@chemlab.org>2010-11-21 04:43:07 -0500
commit6493542ced6999b81ac2076355a2f95ee73d8061 (patch)
tree19ffe7b928778a5d41e1bacbe00b2cedf30237f8
parenta611ed2b6d3cca4c6ca5775ed031adfddc7d341c (diff)
downloadframeworks_base-6493542ced6999b81ac2076355a2f95ee73d8061.zip
frameworks_base-6493542ced6999b81ac2076355a2f95ee73d8061.tar.gz
frameworks_base-6493542ced6999b81ac2076355a2f95ee73d8061.tar.bz2
libstagefright: Fix handling of 'skip' atom in MPEG4Extractor
As per the MPEG4 specs, the contents of the skip atom are irrelevant and can be ignored. Currently, the parser attempted to parse the skip atom which doesn't have any structure. Attempting to parse the skip atom causes a problem if the bytes immediately following the atom type (which denote the size for most other atoms) form a extremely large number. In that case we add this large number to the offset. Eventually, we get out of this atom because we can't parse it. But we fail the 'sanity check' in the previous recursive level since '*offset != stop_offset' would not be true. This change completely ignores the contents of the skip atom. Change-Id: I837e8279aa1417f7c35ed66be80aa6d313a77722
-rwxr-xr-xmedia/libstagefright/MPEG4Extractor.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/media/libstagefright/MPEG4Extractor.cpp b/media/libstagefright/MPEG4Extractor.cpp
index 93d4765..8abcb9c 100755
--- a/media/libstagefright/MPEG4Extractor.cpp
+++ b/media/libstagefright/MPEG4Extractor.cpp
@@ -492,7 +492,6 @@ status_t MPEG4Extractor::parseChunk(off_t *offset, int depth) {
case FOURCC('m', 'o', 'o', 'f'):
case FOURCC('t', 'r', 'a', 'f'):
case FOURCC('m', 'f', 'r', 'a'):
- case FOURCC('s', 'k', 'i' ,'p'):
case FOURCC('u', 'd', 't', 'a'):
case FOURCC('i', 'l', 's', 't'):
{
@@ -1087,6 +1086,8 @@ avcC_parse_fail: //do memory cleanup
break;
}
+ case FOURCC('s', 'k', 'i' ,'p'):
+ //Fall through; we can completely ignore this atom
default:
{
*offset += chunk_size;