summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Nelissen <marcone@google.com>2015-08-18 09:55:24 -0700
committerWolfgang Wiedmeyer <wolfgit@wiedmeyer.de>2015-10-19 02:57:15 +0200
commit7cb902635e3fc1cffcd1bd0892cc1dad4f42497e (patch)
treef22bf77508604091aca9f399c66acf11f7ee09c7
parenta8be67e304caaf45f34078b22dbc46f1f9afe885 (diff)
downloadframeworks_av-7cb902635e3fc1cffcd1bd0892cc1dad4f42497e.zip
frameworks_av-7cb902635e3fc1cffcd1bd0892cc1dad4f42497e.tar.gz
frameworks_av-7cb902635e3fc1cffcd1bd0892cc1dad4f42497e.tar.bz2
Sanity check padding/delay values for gapless playback
Bug: 23306638 Change-Id: I2b5160e0f58f90d3f67c3964f41f5734ec0da053 Tested-by: Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de>
-rwxr-xr-xmedia/libstagefright/SkipCutBuffer.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/media/libstagefright/SkipCutBuffer.cpp b/media/libstagefright/SkipCutBuffer.cpp
index 773854f..4d15d7e 100755
--- a/media/libstagefright/SkipCutBuffer.cpp
+++ b/media/libstagefright/SkipCutBuffer.cpp
@@ -25,6 +25,13 @@
namespace android {
SkipCutBuffer::SkipCutBuffer(int32_t skip, int32_t cut) {
+
+ if (skip < 0 || cut < 0 || cut > 64 * 1024) {
+ ALOGW("out of range skip/cut: %d/%d, using passthrough instead", skip, cut);
+ skip = 0;
+ cut = 0;
+ }
+
mFrontPadding = skip;
mBackPadding = cut;
mWriteHead = 0;