diff options
author | Marco Nelissen <marcone@google.com> | 2015-08-18 09:55:24 -0700 |
---|---|---|
committer | Marco Nelissen <marcone@google.com> | 2015-08-18 09:55:24 -0700 |
commit | ba6093a4c6997b9d36d9700ee8c974941bf82e3a (patch) | |
tree | 8f295f522d965924e9b4e4aff2c7d34a06dc4221 /media | |
parent | f97b6beeb2e2f0977d1c7fa8d2aaafe4e2f4d68a (diff) | |
download | frameworks_av-ba6093a4c6997b9d36d9700ee8c974941bf82e3a.zip frameworks_av-ba6093a4c6997b9d36d9700ee8c974941bf82e3a.tar.gz frameworks_av-ba6093a4c6997b9d36d9700ee8c974941bf82e3a.tar.bz2 |
Sanity check padding/delay values for gapless playback
Bug: 23306638
Change-Id: I2b5160e0f58f90d3f67c3964f41f5734ec0da053
Diffstat (limited to 'media')
-rw-r--r-- | media/libstagefright/SkipCutBuffer.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/media/libstagefright/SkipCutBuffer.cpp b/media/libstagefright/SkipCutBuffer.cpp index 773854f..4d15d7e 100644 --- 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; |