From fd7fa9c3ac41e7f95a91a5ec1d8fac00058fc2c5 Mon Sep 17 00:00:00 2001 From: Jean-Yves Avenard Date: Mon, 21 Sep 2015 11:46:39 +1000 Subject: [PATCH] Bug 1138992: P1. Ignore ctts version if we have 0 samples in the table. r=kentuckyfriedtakahe --- .../frameworks/av/media/libstagefright/SampleTable.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/media/libstagefright/frameworks/av/media/libstagefright/SampleTable.cpp b/media/libstagefright/frameworks/av/media/libstagefright/SampleTable.cpp index b52013cb361..66011c4afab 100644 --- a/media/libstagefright/frameworks/av/media/libstagefright/SampleTable.cpp +++ b/media/libstagefright/frameworks/av/media/libstagefright/SampleTable.cpp @@ -388,13 +388,13 @@ status_t SampleTable::setCompositionTimeToSampleParams( return ERROR_IO; } - if (U32_AT(header) != 0) { + uint32_t numEntries = U32_AT(&header[4]); + + if (U32_AT(header) != 0 && numEntries) { // Expected version = 0, flags = 0. return ERROR_MALFORMED; } - uint32_t numEntries = U32_AT(&header[4]); - if (data_size != ((uint64_t)numEntries + 1) * 8) { return ERROR_MALFORMED; }