summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/WAVExtractor.cpp
diff options
context:
space:
mode:
authorGloria Wang <gwang@google.com>2011-07-22 14:42:28 -0700
committerGloria Wang <gwang@google.com>2011-07-22 14:42:28 -0700
commit0b3f21761eae9b7d230ddd9b4be76ef02d4cec15 (patch)
treecd768728447d3f07c519f8854a0d82d7b5b833b6 /media/libstagefright/WAVExtractor.cpp
parent60c93010e8f96a179574ec66c00ec47a675319e3 (diff)
downloadframeworks_av-0b3f21761eae9b7d230ddd9b4be76ef02d4cec15.zip
frameworks_av-0b3f21761eae9b7d230ddd9b4be76ef02d4cec15.tar.gz
frameworks_av-0b3f21761eae9b7d230ddd9b4be76ef02d4cec15.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
Diffstat (limited to 'media/libstagefright/WAVExtractor.cpp')
-rw-r--r--media/libstagefright/WAVExtractor.cpp4
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;
}