diff options
Diffstat (limited to 'media/libstagefright/foundation/base64.cpp')
-rw-r--r-- | media/libstagefright/foundation/base64.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/media/libstagefright/foundation/base64.cpp b/media/libstagefright/foundation/base64.cpp index 7da7db9411..cc89064067 100644 --- a/media/libstagefright/foundation/base64.cpp +++ b/media/libstagefright/foundation/base64.cpp @@ -78,8 +78,7 @@ sp<ABuffer> decodeBase64(const AString &s) { accum = (accum << 6) | value; if (((i + 1) % 4) == 0) { - out[j++] = (accum >> 16); - + if (j < outLen) { out[j++] = (accum >> 16); } if (j < outLen) { out[j++] = (accum >> 8) & 0xff; } if (j < outLen) { out[j++] = accum & 0xff; } |