[automerger] Fix possible out of bounds read am: 3762e06152 am: ecc92a1a86 am: 1c7bb87a42 am: 4cdd5c3af5 am: bad0533d2e
Change-Id: Ia5a88da9a0fb034270bacc91b2079e56faecc100
diff --git a/media/libstagefright/id3/ID3.cpp b/media/libstagefright/id3/ID3.cpp
index 4e1cdf6..ca2be54 100644
--- a/media/libstagefright/id3/ID3.cpp
+++ b/media/libstagefright/id3/ID3.cpp
@@ -603,6 +603,9 @@
// UCS-2
// API wants number of characters, not number of bytes...
int len = n / 2;
+ if (len == 0) {
+ return;
+ }
const char16_t *framedata = (const char16_t *) (frameData + 1);
char16_t *framedatacopy = NULL;
if (*framedata == 0xfffe) {