OSDN Git Service

DO NOT MERGE: defensive parsing of mp3 album art information
authorRay Essick <essick@google.com>
Wed, 2 Nov 2016 21:17:06 +0000 (14:17 -0700)
committerRay Essick <essick@google.com>
Wed, 2 Nov 2016 21:17:06 +0000 (14:17 -0700)
commit21f28142605f34d7194b7f710ae7b77f3aed2123
tree80374bf0f64bb7cb92eca1ae28404777d1229f07
parentdb358e20c6752f82a53d35c884ce58a923bd31b3
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: Ib46cd1b5a3e1707c343d395f235bedb82764e184
media/libstagefright/id3/ID3.cpp