From 8ee368522ca7df126033a05dc3c430182b4495c9 Mon Sep 17 00:00:00 2001 From: Marco Nelissen Date: Thu, 22 Oct 2015 11:05:03 -0700 Subject: Fix offset adjustment when skipping off-spec meta chunk Bug: 25172843 Change-Id: Ibbfe4369176f2a367eab5a39fd742f425b017288 --- media/libstagefright/MPEG4Extractor.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'media/libstagefright/MPEG4Extractor.cpp') diff --git a/media/libstagefright/MPEG4Extractor.cpp b/media/libstagefright/MPEG4Extractor.cpp index a1af3aa..bfdff38 100755 --- a/media/libstagefright/MPEG4Extractor.cpp +++ b/media/libstagefright/MPEG4Extractor.cpp @@ -1776,13 +1776,13 @@ status_t MPEG4Extractor::parseChunk(off64_t *offset, int depth) { if (!isParsingMetaKeys) { uint8_t buffer[4]; if (chunk_data_size < (off64_t)sizeof(buffer)) { - *offset += chunk_size; + *offset = stop_offset; return ERROR_MALFORMED; } if (mDataSource->readAt( data_offset, buffer, 4) < 4) { - *offset += chunk_size; + *offset = stop_offset; return ERROR_IO; } @@ -1793,7 +1793,7 @@ status_t MPEG4Extractor::parseChunk(off64_t *offset, int depth) { // apparently malformed chunks that don't have flags // and completely different semantics than what's // in the MPEG4 specs and skip it. - *offset += chunk_size; + *offset = stop_offset; return OK; } *offset += sizeof(buffer); -- cgit v1.1