Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit af29aba5 authored by Marco Nelissen's avatar Marco Nelissen Committed by The Android Automerger
Browse files

Sanity check padding/delay values for gapless playback

Bug: 23306638
Change-Id: I2b5160e0f58f90d3f67c3964f41f5734ec0da053
parent 3db5231c
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -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 = mSkip = skip;
    mBackPadding = cut;
    mWriteHead = 0;