}
}
+static void __id3tag_skip_newline(unsigned char *pTagVal, int *nTagLen, int *offset)
+{
+ /* skip newline in text encoding of ID3 tag frame */
+ while ((NEWLINE_OF_UTF16(pTagVal + *offset) || NEWLINE_OF_UTF16_R(pTagVal + *offset)) && *nTagLen > 4) {
+ *nTagLen -= 4;
+ *offset += 4;
+ }
+}
+
static bool __id3tag_parse_PIC_format(AvFileContentInfo *pInfo, unsigned char *pTagVal, int *offset)
{
unsigned int idx = 0;
/*pExtContent[tmp+1] value should't have encoding value */
if (pExtContent[tmp] == 0x00 || pExtContent[tmp] == 0xFF || pExtContent[tmp] == 0xFE) {
if ((IS_ENCODEDBY_UTF16(pExtContent + tmp) || IS_ENCODEDBY_UTF16_R(pExtContent + tmp)) && realCpyFrameNum > 2) {
- while ((NEWLINE_OF_UTF16(pExtContent + tmp) || NEWLINE_OF_UTF16_R(pExtContent + tmp)) && realCpyFrameNum > 4) {
- realCpyFrameNum -= 4;
- tmp += 4;
- }
+ __id3tag_skip_newline(pExtContent, &realCpyFrameNum, &tmp);
if (IS_ENCODEDBY_UTF16(pExtContent + tmp) && (realCpyFrameNum > 2)) {
realCpyFrameNum -= 2;
/*pExtContent[tmp+1] value should't have encoding value */
if (pExtContent[tmp] == 0x00 || pExtContent[tmp] == 0xFF || pExtContent[tmp] == 0xFE) {
if ((IS_ENCODEDBY_UTF16(pExtContent + tmp) || IS_ENCODEDBY_UTF16_R(pExtContent + tmp)) && realCpyFrameNum > 2) {
- while ((NEWLINE_OF_UTF16(pExtContent + tmp) || NEWLINE_OF_UTF16_R(pExtContent + tmp)) && realCpyFrameNum > 4) {
- realCpyFrameNum -= 4;
- tmp += 4;
- }
+ __id3tag_skip_newline(pExtContent, &realCpyFrameNum, &tmp);
if (IS_ENCODEDBY_UTF16(pExtContent + tmp) && (realCpyFrameNum > 2)) {
realCpyFrameNum -= 2;
if (pExtContent[tmp] == 0x00 || pExtContent[tmp] == 0xFF || pExtContent[tmp] == 0xFE) {
if ((IS_ENCODEDBY_UTF16(pExtContent + tmp) || IS_ENCODEDBY_UTF16_R(pExtContent + tmp)) && realCpyFrameNum > 2) {
- while ((NEWLINE_OF_UTF16(pExtContent + tmp) || NEWLINE_OF_UTF16_R(pExtContent + tmp)) && realCpyFrameNum > 4) {
- realCpyFrameNum -= 4;
- tmp += 4;
- }
+ __id3tag_skip_newline(pExtContent, &realCpyFrameNum, &tmp);
if (IS_ENCODEDBY_UTF16(pExtContent + tmp) && (realCpyFrameNum > 2)) {
realCpyFrameNum -= 2;
tmp = 3;
if (textEncodingType == AV_ID3V2_UTF16 || textEncodingType == AV_ID3V2_UTF16_BE) {
- while ((NEWLINE_OF_UTF16(pExtContent + tmp) || NEWLINE_OF_UTF16_R(pExtContent + tmp)) && realCpyFrameNum > 4) {
- realCpyFrameNum -= 4;
- tmp += 4;
- }
+ __id3tag_skip_newline(pExtContent, &realCpyFrameNum, &tmp);
if ((IS_ENCODEDBY_UTF16(pExtContent + tmp) || IS_ENCODEDBY_UTF16_R(pExtContent + tmp)) && realCpyFrameNum > 2) {
realCpyFrameNum -= 2;
tmp = 5;
if (textEncodingType == AV_ID3V2_UTF16 || textEncodingType == AV_ID3V2_UTF16_BE) {
- while ((NEWLINE_OF_UTF16(pExtContent + tmp) || NEWLINE_OF_UTF16_R(pExtContent + tmp)) && realCpyFrameNum > 4) {
- realCpyFrameNum -= 4;
- tmp += 4;
- }
+ __id3tag_skip_newline(pExtContent, &realCpyFrameNum, &tmp);
if ((IS_ENCODEDBY_UTF16(pExtContent + tmp) || IS_ENCODEDBY_UTF16_R(pExtContent + tmp)) && realCpyFrameNum > 2) {
realCpyFrameNum -= 2;
tmp = 3;
if (textEncodingType == AV_ID3V2_UTF16 || textEncodingType == AV_ID3V2_UTF16_BE) {
- while ((NEWLINE_OF_UTF16(pExtContent + tmp) || NEWLINE_OF_UTF16_R(pExtContent + tmp)) && realCpyFrameNum > 4) {
- realCpyFrameNum -= 4;
- tmp += 4;
- }
+ __id3tag_skip_newline(pExtContent, &realCpyFrameNum, &tmp);
if ((IS_ENCODEDBY_UTF16(pExtContent + tmp) || IS_ENCODEDBY_UTF16_R(pExtContent + tmp)) && realCpyFrameNum > 2) {
realCpyFrameNum -= 2;