Fix for 5754998 testPerformanceTransitionWithEffectOverlapping test failed.
-Fix the index is out of sync frame array boundary when seeking to end of a 3gp file.
Validation only were done for video editor cts test and Movie Studio application.
Futher validation may include media player, youtube application,.etc.
Change-Id: Ib01314f1768cfab702dbe25c307553ace0b85e77
diff --git a/media/libstagefright/SampleTable.cpp b/media/libstagefright/SampleTable.cpp
index 8e790fc..3e287fa 100644
--- a/media/libstagefright/SampleTable.cpp
+++ b/media/libstagefright/SampleTable.cpp
@@ -632,6 +632,13 @@
break;
}
}
+ if (left == mNumSyncSamples) {
+ if (flags == kFlagAfter) {
+ LOGE("tried to find a sync frame after the last one: %d", left);
+ return ERROR_OUT_OF_RANGE;
+ }
+ left = left - 1;
+ }
// Now ssi[left] is the sync sample index just before (or at)
// start_sample_index.