From 5f995b0e72ed6f186cb0ab2a525c4cfce614f3a9 Mon Sep 17 00:00:00 2001 From: Andreas Huber Date: Wed, 20 Oct 2010 14:29:41 -0700 Subject: Make sure we can encode the size of the codec specific data in a single byte. Change-Id: If7680cbfb380180c8dd6d6019b9c6c67661e468d --- media/libstagefright/MPEG4Writer.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/media/libstagefright/MPEG4Writer.cpp b/media/libstagefright/MPEG4Writer.cpp index e53b0a0..6c8287c 100644 --- a/media/libstagefright/MPEG4Writer.cpp +++ b/media/libstagefright/MPEG4Writer.cpp @@ -2194,6 +2194,9 @@ void MPEG4Writer::Track::writeTrackHeader( CHECK(mCodecSpecificData); CHECK(mCodecSpecificDataSize > 0); + // Make sure all sizes encode to a single byte. + CHECK(mCodecSpecificDataSize + 23 < 128); + mOwner->writeInt32(0); // version=0, flags=0 mOwner->writeInt8(0x03); // ES_DescrTag mOwner->writeInt8(23 + mCodecSpecificDataSize); -- cgit v1.1