From 007ffc84ce7ec87cc6c3507ae2406231b22eddc1 Mon Sep 17 00:00:00 2001 From: Gerald Squelart Date: Thu, 5 Nov 2015 19:06:00 +0100 Subject: [PATCH] Bug 1181223 - p2: Handle wrong saio/saiz size instead of assuming it is correct - r=rillian --- .../av/media/libstagefright/SampleTable.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/media/libstagefright/frameworks/av/media/libstagefright/SampleTable.cpp b/media/libstagefright/frameworks/av/media/libstagefright/SampleTable.cpp index 66011c4afab7..f43b6691fcdb 100644 --- a/media/libstagefright/frameworks/av/media/libstagefright/SampleTable.cpp +++ b/media/libstagefright/frameworks/av/media/libstagefright/SampleTable.cpp @@ -547,7 +547,12 @@ SampleTable::setSampleAuxiliaryInformationSizeParams( data_offset += mCencInfoCount; } - CHECK(data_offset == data_end); + if (data_offset != data_end) { + ALOGW("wrong saiz data size, expected %lu, actual %lu", + data_size, data_offset - (data_end - data_size)); + // Continue, assume extra data is not important. + // Parser will skip past the box end. + } return parseSampleCencInfo(); } @@ -612,7 +617,12 @@ SampleTable::setSampleAuxiliaryInformationOffsetParams( } } - CHECK(data_offset == data_end); + if (data_offset != data_end) { + ALOGW("wrong saio data size, expected %lu, actual %lu", + data_size, data_offset - (data_end - data_size)); + // Continue, assume extra data is not important. + // Parser will skip past the box end. + } return parseSampleCencInfo(); }