unsigned char *pExtContent = NULL;
unsigned long purelyFramelen = 0;
unsigned int encodingOffSet = 0;
- int realCpyFrameNum = 0, tmp = 0;
+ int realCpyFrameNum = 0;
int textEncodingType = 0;
char **charset_array = NULL;
AvID3TagList tag_id = AV_ID3TAG_MAX;
switch (tag_id) {
case AV_ID3TAG_COMMENT:
- /*skip language data! */
- if (realCpyFrameNum > 4) {
- realCpyFrameNum -= 4;
- tmp = 4;
-
- /*pExtContent[tmp+1] value should't have encoding value */
- if (pExtContent[tmp] > 0x20 && (pExtContent[tmp - 1] == 0x00 || pExtContent[tmp - 1] == 0x01)) {
- textEncodingType = __id3tag_get_text_encoding_v222(pExtContent, tmp);
- pInfo->tagInfo[tag_id].value = mmfile_convert_to_utf8((const char *)pExtContent, realCpyFrameNum, charset_array[textEncodingType]);
- } else {
- debug_msg(RELEASE, "mmf_file_id3tag_parse_v222: failed to get Comment: tmp(%d), purelyFramelen - encodingOffSet(%lu)", tmp, purelyFramelen - encodingOffSet);
- }
- } else {
- debug_msg(RELEASE, "mmf_file_id3tag_parse_v222: Description info too small to parse realCpyFrameNum(%d)", realCpyFrameNum);
- }
- break;
-
+ /* fall through */
case AV_ID3TAG_URL:
- if (realCpyFrameNum > 4) {
- /*skip language data! */
- realCpyFrameNum -= 4;
- tmp = 4;
+ if (realCpyFrameNum <= 4) {
+ debug_msg(RELEASE, "Too small to parse realCpyFrameNum(%d)", realCpyFrameNum);
+ break;
+ }
- /*pExtContent[tmp+1] value should't have null value */
- if (pExtContent[tmp] > 0x20 && (pExtContent[tmp - 1] == 0x00 || pExtContent[tmp - 1] == 0x01)) {
- textEncodingType = __id3tag_get_text_encoding_v222(pExtContent, tmp);
+ /*skip language data! */
+ realCpyFrameNum -= 4;
- pInfo->tagInfo[tag_id].value = mmfile_convert_to_utf8((const char *)pExtContent, realCpyFrameNum, charset_array[textEncodingType]);
- } else {
- debug_msg(RELEASE, "mmf_file_id3tag_parse_v222: failed to get URL Info tmp(%d), purelyFramelen - encodingOffSet(%lu)", tmp, purelyFramelen - encodingOffSet);
- }
+ if (pExtContent[4] > 0x20 && (pExtContent[3] == 0x00 || pExtContent[3] == 0x01)) {
+ textEncodingType = __id3tag_get_text_encoding_v222(pExtContent, 4);
+ pInfo->tagInfo[tag_id].value = mmfile_convert_to_utf8((const char *)pExtContent, realCpyFrameNum, charset_array[textEncodingType]);
} else {
- debug_msg(RELEASE, "mmf_file_id3tag_parse_v222: URL info too small to parse realCpyFrameNum(%d)", realCpyFrameNum);
+ debug_msg(RELEASE, "Failed to get tag: purelyFramelen - encodingOffSet(%lu)", purelyFramelen - encodingOffSet);
}
+
break;
case AV_ID3TAG_PICTURE: