diff options
author | Gloria Wang <gwang@google.com> | 2011-07-22 14:42:28 -0700 |
---|---|---|
committer | Gloria Wang <gwang@google.com> | 2011-07-22 14:42:28 -0700 |
commit | 75cfd5b87994a3c44cd4ad07a85a7fabf51f669a (patch) | |
tree | dc24145b99fd80e58a72614823c3eabd99bddd28 | |
parent | ae5df05f2246515a652f0c935c6deb85a0bdee01 (diff) | |
download | frameworks_base-75cfd5b87994a3c44cd4ad07a85a7fabf51f669a.zip frameworks_base-75cfd5b87994a3c44cd4ad07a85a7fabf51f669a.tar.gz frameworks_base-75cfd5b87994a3c44cd4ad07a85a7fabf51f669a.tar.bz2 |
Do not change the number of bytes while converting 8-bit samples to 16-bit,
because this number will be used later to calculate mCurrentPos.
Fix for bug 5063703.
Change-Id: I75a78ef694482aa426d82a6c5f3d2ce570a9c19e
-rw-r--r-- | media/libstagefright/WAVExtractor.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/media/libstagefright/WAVExtractor.cpp b/media/libstagefright/WAVExtractor.cpp index bf978d7..c406964 100644 --- a/media/libstagefright/WAVExtractor.cpp +++ b/media/libstagefright/WAVExtractor.cpp @@ -370,7 +370,9 @@ status_t WAVSource::read( int16_t *dst = (int16_t *)tmp->data(); const uint8_t *src = (const uint8_t *)buffer->data(); - while (n-- > 0) { + ssize_t numBytes = n; + + while (numBytes-- > 0) { *dst++ = ((int16_t)(*src) - 128) * 256; ++src; } |