summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Nelissen <marcone@google.com>2018-06-01 10:48:25 -0700
committerTim Schumacher <timschumi@gmx.de>2018-08-08 21:23:33 +0200
commit61c1950d60b1b29567cee9c8e73e4c336b618496 (patch)
tree73183142c08570ed7b5125029ba2b828144560a1
parentdc3b246bb1422b805937343e65b513d246952eb6 (diff)
downloadframeworks_av-61c1950d60b1b29567cee9c8e73e4c336b618496.tar.gz
frameworks_av-61c1950d60b1b29567cee9c8e73e4c336b618496.tar.bz2
frameworks_av-61c1950d60b1b29567cee9c8e73e4c336b618496.zip
Fix possible out of bounds read
Bug: 78656554 Test: manual Change-Id: I677f827483dcc80afac57fd7ef6807e633542252 (cherry picked from commit 3762e0615273f25b059556d5b5f65102e9c55c35)
-rw-r--r--media/libstagefright/id3/ID3.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/media/libstagefright/id3/ID3.cpp b/media/libstagefright/id3/ID3.cpp
index d97d444bd6..29fcf1a047 100644
--- a/media/libstagefright/id3/ID3.cpp
+++ b/media/libstagefright/id3/ID3.cpp
@@ -604,6 +604,9 @@ void ID3::Iterator::getstring(String8 *id, bool otherdata) const {
// 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) {