diff options
author | Marco Nelissen <marcone@google.com> | 2015-01-15 22:16:01 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2015-01-15 22:16:01 +0000 |
commit | 1efe46deb86b8ca246e2486ec16d88efd9e1e657 (patch) | |
tree | e0b67a8756635bfa7022a686f7530fbcd9004fda | |
parent | 724b9ea51db0c191cc3184319719a38b5a1f6502 (diff) | |
parent | ba6e982635f11bced34897f4317cbe8ff1c89483 (diff) | |
download | frameworks_av-1efe46deb86b8ca246e2486ec16d88efd9e1e657.zip frameworks_av-1efe46deb86b8ca246e2486ec16d88efd9e1e657.tar.gz frameworks_av-1efe46deb86b8ca246e2486ec16d88efd9e1e657.tar.bz2 |
Merge "Fix id3 parser crash"
-rw-r--r-- | media/libstagefright/id3/ID3.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/media/libstagefright/id3/ID3.cpp b/media/libstagefright/id3/ID3.cpp index d8bfada..d9491d6 100644 --- a/media/libstagefright/id3/ID3.cpp +++ b/media/libstagefright/id3/ID3.cpp @@ -630,7 +630,10 @@ void ID3::Iterator::findFrame() { | (mParent.mData[mOffset + 4] << 8) | mParent.mData[mOffset + 5]; - mFrameSize += 6; + if (mFrameSize == 0) { + return; + } + mFrameSize += 6; // add tag id and size field if (mOffset + mFrameSize > mParent.mSize) { ALOGV("partial frame at offset %zu (size = %zu, bytes-remaining = %zu)", @@ -671,7 +674,11 @@ void ID3::Iterator::findFrame() { baseSize = U32_AT(&mParent.mData[mOffset + 4]); } - mFrameSize = 10 + baseSize; + if (baseSize == 0) { + return; + } + + mFrameSize = 10 + baseSize; // add tag id, size field and flags if (mOffset + mFrameSize > mParent.mSize) { ALOGV("partial frame at offset %zu (size = %zu, bytes-remaining = %zu)", |