OSDN Git Service

DO NOT MERGE: defensive parsing of mp3 album art information
authorRay Essick <essick@google.com>
Wed, 2 Nov 2016 21:15:43 +0000 (14:15 -0700)
committerRay Essick <essick@google.com>
Wed, 2 Nov 2016 21:15:43 +0000 (14:15 -0700)
commit2ff80538b7063545e5e006f3eca96115175e7c82
treee2363b4eff58351d06e76cd80ea70f32458db644
parent2c28e5b1266a12163fed8236d34830f69f8216a2
DO NOT MERGE: defensive parsing of mp3 album art information

several points in stagefrights mp3 album art code
used strlen() to parse user-supplied strings that may be
unterminated, resulting in reading beyond the end of a buffer.

This changes the code to use strnlen() for 8-bit encodings and
strengthens the parsing of 16-bit encodings similarly. It also
reworks how we watch for the end-of-buffer to avoid all over-reads.

Bug: 32377688
Test: crafted mp3's w/ good/bad cover art. See what showed in play music
Change-Id: Idbaf221fa2283b33e83f399562a3323dd095cc2c
media/libstagefright/id3/ID3.cpp