From be5016bac5c1b422d850e299d3cb11fecf0ac19d Mon Sep 17 00:00:00 2001 From: Jesper Tragardh Date: Wed, 11 Jul 2012 14:13:47 +0200 Subject: Correct ID3::StringSize calculation for UCS-2 data. Album art was not displayed when albums were transferred via MediaGo because the length of the description in the APIC tag was not correctly calculated. The method StringSize used to calculate the length of the tag does not add the size of the null termination in UCS-2 case. Change-Id: I5409d42f5e87d315e6e03c4d7e6cbd8a378a160d --- media/libstagefright/id3/ID3.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'media/libstagefright/id3') diff --git a/media/libstagefright/id3/ID3.cpp b/media/libstagefright/id3/ID3.cpp index ca14054..69274ca 100644 --- a/media/libstagefright/id3/ID3.cpp +++ b/media/libstagefright/id3/ID3.cpp @@ -743,7 +743,8 @@ static size_t StringSize(const uint8_t *start, uint8_t encoding) { n += 2; } - return n; + // Add size of null termination. + return n + 2; } const void * -- cgit v1.1