summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/foundation
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2014-02-10 14:40:45 -0800
committerAndreas Huber <andih@google.com>2014-02-11 11:50:54 -0800
commit4bbfff2dbf3968c267c3b2ea9f8912a38372a9da (patch)
tree5e9dc59c018069605c0a1591971dbb762419ae17 /media/libstagefright/foundation
parent1d6fa7af1288b550faabe4ec2cf98684236723db (diff)
downloadframeworks_av-4bbfff2dbf3968c267c3b2ea9f8912a38372a9da.zip
frameworks_av-4bbfff2dbf3968c267c3b2ea9f8912a38372a9da.tar.gz
frameworks_av-4bbfff2dbf3968c267c3b2ea9f8912a38372a9da.tar.bz2
Support "data:" URIs again in mediaplayer...
Change-Id: I6dac35c7e606f738a60f985f6dca977dc92c82a4 related-to-bug: 12957757
Diffstat (limited to 'media/libstagefright/foundation')
-rw-r--r--media/libstagefright/foundation/base64.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/media/libstagefright/foundation/base64.cpp b/media/libstagefright/foundation/base64.cpp
index d5fb4e0..dcf5bef 100644
--- a/media/libstagefright/foundation/base64.cpp
+++ b/media/libstagefright/foundation/base64.cpp
@@ -33,6 +33,10 @@ sp<ABuffer> decodeBase64(const AString &s) {
if (n >= 2 && s.c_str()[n - 2] == '=') {
padding = 2;
+
+ if (n >= 3 && s.c_str()[n - 3] == '=') {
+ padding = 3;
+ }
}
}
@@ -71,7 +75,7 @@ sp<ABuffer> decodeBase64(const AString &s) {
if (((i + 1) % 4) == 0) {
out[j++] = (accum >> 16);
- if (j < outLen) { out[j++] = (accum >> 8) & 0xff; }
+ if (j < outLen) { out[j++] = (accum >> 8) & 0xff; }
if (j < outLen) { out[j++] = accum & 0xff; }
accum = 0;