frameworks/av
Revision | e3032ea219db3a818c900cef35ce1e2db75cc334 (tree) |
---|---|
Time | 2019-10-30 05:03:14 |
Author | TreeHugger Robot <treehugger-gerrit@goog...> |
Commiter | Android (Google) Code Review |
Merge "aacenc: fix possible shift in remainder" into qt-qpr1-dev
@@ -521,16 +521,14 @@ void C2SoftAacEnc::process( | ||
521 | 521 | mInputSize += outargs.numInSamples * sizeof(int16_t); |
522 | 522 | } |
523 | 523 | |
524 | - if (outargs.numInSamples > 0) { | |
525 | - inBuffer[0] = (int16_t *)inBuffer[0] + outargs.numInSamples; | |
526 | - inBufferSize[0] -= outargs.numInSamples * sizeof(int16_t); | |
527 | - inargs.numInSamples -= outargs.numInSamples; | |
528 | - } | |
529 | - | |
530 | 524 | if (inBuffer[0] == mRemainder) { |
531 | 525 | inBuffer[0] = const_cast<uint8_t *>(data); |
532 | 526 | inBufferSize[0] = capacity; |
533 | 527 | inargs.numInSamples = capacity / sizeof(int16_t); |
528 | + } else if (outargs.numInSamples > 0) { | |
529 | + inBuffer[0] = (int16_t *)inBuffer[0] + outargs.numInSamples; | |
530 | + inBufferSize[0] -= outargs.numInSamples * sizeof(int16_t); | |
531 | + inargs.numInSamples -= outargs.numInSamples; | |
534 | 532 | } |
535 | 533 | } |
536 | 534 | ALOGV("encoderErr = %d mInputSize = %zu " |