mp4 extractor: Too big sample timestamp can lead to overflow Exception.
seekTo in the video track will query the timestamp, PTS of the sample according to the seekTo time. The PTS value greater than UNIT_32_Max can cause the uint_32 overflow during the calculation.
Test: To test the videoes that the PTS value is greater than UNIT_32_Max, find out the relative overflows in the logs.
Change-Id: I796e3abcd7d0aad1614c07119a3012fc641266d8
diff --git a/media/extractors/mp4/SampleTable.h b/media/extractors/mp4/SampleTable.h
index d4b5dc8..57f6e62 100644
--- a/media/extractors/mp4/SampleTable.h
+++ b/media/extractors/mp4/SampleTable.h
@@ -66,9 +66,9 @@
uint32_t sampleIndex,
off64_t *offset,
size_t *size,
- uint32_t *compositionTime,
+ uint64_t *compositionTime,
bool *isSyncSample = NULL,
- uint32_t *sampleDuration = NULL);
+ uint64_t *sampleDuration = NULL);
// call only after getMetaDataForSample has been called successfully.
uint32_t getLastSampleIndexInChunk();
@@ -124,7 +124,7 @@
struct SampleTimeEntry {
uint32_t mSampleIndex;
- uint32_t mCompositionTime;
+ uint64_t mCompositionTime;
};
SampleTimeEntry *mSampleTimeEntries;