Fix typos and pointer math.

Change-Id: I07f33a57454d013844b56bc3e57fe0a271e8b38c
diff --git a/include/ndk/NdkMediaCodec.h b/include/ndk/NdkMediaCodec.h
index 5233fe3..28d121c 100644
--- a/include/ndk/NdkMediaCodec.h
+++ b/include/ndk/NdkMediaCodec.h
@@ -179,7 +179,7 @@
         size_t *encryptedbytes);
 
 /**
- * delete an AMediaCodecCryptoInfo create previously with AMediaCodecCryptoInfo_new, or
+ * delete an AMediaCodecCryptoInfo created previously with AMediaCodecCryptoInfo_new, or
  * obtained from AMediaExtractor
  */
 int AMediaCodecCryptoInfo_delete(AMediaCodecCryptoInfo*);
diff --git a/include/ndk/NdkMediaCrypto.h b/include/ndk/NdkMediaCrypto.h
index 0bcba9f..83eaad2 100644
--- a/include/ndk/NdkMediaCrypto.h
+++ b/include/ndk/NdkMediaCrypto.h
@@ -39,7 +39,7 @@
 
 typedef uint8_t AMediaUUID[16];
 
-bool AMediaCrypto_isCryptoSchemeSupport(const AMediaUUID uuid);
+bool AMediaCrypto_isCryptoSchemeSupported(const AMediaUUID uuid);
 
 bool AMediaCrypto_requiresSecureDecoderComponent(const char *mime);
 
diff --git a/media/ndk/NdkMediaCodec.cpp b/media/ndk/NdkMediaCodec.cpp
index 1f62fa2..ac05920 100644
--- a/media/ndk/NdkMediaCodec.cpp
+++ b/media/ndk/NdkMediaCodec.cpp
@@ -369,7 +369,7 @@
     if (err != 0) {
         ALOGE("queSecureInputBuffer: %s", errormsg.c_str());
     }
-    delete subSamples;
+    delete [] subSamples;
     return translate_error(err);
 }
 
@@ -396,13 +396,11 @@
     ret->mode = mode;
 
     // clearbytes and encryptedbytes point at the actual data, which follows
-    ret->clearbytes = (size_t*) ((&ret->encryptedbytes) + sizeof(ret->encryptedbytes));
-    ret->encryptedbytes = (size_t*) (ret->clearbytes + (sizeof(size_t) * numsubsamples));
+    ret->clearbytes = (size_t*) (ret + 1); // point immediately after the struct
+    ret->encryptedbytes = ret->clearbytes + numsubsamples; // point after the clear sizes
 
-    size_t *dst = ret->clearbytes;
-    memcpy(dst, clearbytes, numsubsamples * sizeof(size_t));
-    dst += numsubsamples * sizeof(size_t);
-    memcpy(dst, encryptedbytes, numsubsamples * sizeof(size_t));
+    memcpy(ret->clearbytes, clearbytes, numsubsamples * sizeof(size_t));
+    memcpy(ret->encryptedbytes, encryptedbytes, numsubsamples * sizeof(size_t));
 
     return ret;
 }
diff --git a/media/ndk/NdkMediaCrypto.cpp b/media/ndk/NdkMediaCrypto.cpp
index 25dfe6a..d57f42b 100644
--- a/media/ndk/NdkMediaCrypto.cpp
+++ b/media/ndk/NdkMediaCrypto.cpp
@@ -74,7 +74,7 @@
 extern "C" {
 
 
-bool AMediaCrypto_isCryptoSchemeSupport(const AMediaUUID uuid) {
+bool AMediaCrypto_isCryptoSchemeSupported(const AMediaUUID uuid) {
     sp<ICrypto> crypto = makeCrypto();
     if (crypto == NULL) {
         return false;