From 8a8f950cddb254f8e9bf4ef013d0381f1dd6b4ee Mon Sep 17 00:00:00 2001 From: Minje Ahn Date: Tue, 27 Oct 2020 13:00:52 +0900 Subject: [PATCH] Use g_ascii_isalnum() instead Change-Id: I86b8361718448d8fec4eb292945400655c735632 Signed-off-by: Minje Ahn --- utils/mm_file_util_tag.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/utils/mm_file_util_tag.c b/utils/mm_file_util_tag.c index df8093b..b699778 100644 --- a/utils/mm_file_util_tag.c +++ b/utils/mm_file_util_tag.c @@ -2917,8 +2917,9 @@ bool mm_file_id3tag_parse_v222(AvFileContentInfo *pInfo, unsigned char *buffer) debug_msg(RELEASE, "ID3tag v222--------------------------------------------------------------"); while (needToloopv2taglen > MP3_TAGv2_22_TXT_HEADER_LEN) { - if ((buffer[curPos] < '0' || buffer[curPos] > 'Z') || (buffer[curPos + 1] < '0' || buffer[curPos + 1] > 'Z') - || (buffer[curPos + 2] < '0' || buffer[curPos + 2] > 'Z')) + if (!g_ascii_isalnum(buffer[curPos]) || + !g_ascii_isalnum(buffer[curPos + 1]) || + !g_ascii_isalnum(buffer[curPos + 2])) break; memcpy(CompTmp, &buffer[curPos], 3); @@ -2997,7 +2998,6 @@ bool mm_file_id3tag_parse_v222(AvFileContentInfo *pInfo, unsigned char *buffer) } break; - case AV_ID3TAG_PICTURE: if (realCpyFrameNum <= 2000000) _mm_file_id3tag_parse_PIC(pInfo, pExtContent, realCpyFrameNum, (const char*)charset_array[textEncodingType]); @@ -3080,8 +3080,8 @@ bool mm_file_id3tag_parse_v223(AvFileContentInfo *pInfo, unsigned char *buffer) } while (needToloopv2taglen > MP3_TAGv2_23_TXT_HEADER_LEN) { - if ((buffer[curPos] < '0' || buffer[curPos] > 'Z') || (buffer[curPos + 1] < '0' || buffer[curPos + 1] > 'Z') - || (buffer[curPos + 2] < '0' || buffer[curPos + 2] > 'Z') || (buffer[curPos + 3] < '0' || buffer[curPos + 3] > 'Z')) + if (!g_ascii_isalnum(buffer[curPos]) || !g_ascii_isalnum(buffer[curPos + 1]) || + !g_ascii_isalnum(buffer[curPos + 2]) || !g_ascii_isalnum(buffer[curPos + 3])) break; memcpy(CompTmp, &buffer[curPos], 4); @@ -3331,8 +3331,8 @@ bool mm_file_id3tag_parse_v224(AvFileContentInfo *pInfo, unsigned char *buffer) } while (needToloopv2taglen > MP3_TAGv2_23_TXT_HEADER_LEN) { - if ((buffer[curPos] < '0' || buffer[curPos] > 'Z') || (buffer[curPos + 1] < '0' || buffer[curPos + 1] > 'Z') - || (buffer[curPos + 2] < '0' || buffer[curPos + 2] > 'Z') || (buffer[curPos + 3] < '0' || buffer[curPos + 3] > 'Z')) + if (!g_ascii_isalnum(buffer[curPos]) || !g_ascii_isalnum(buffer[curPos + 1]) || + !g_ascii_isalnum(buffer[curPos + 2]) || !g_ascii_isalnum(buffer[curPos + 3])) break; memcpy(CompTmp, &buffer[curPos], 4); -- 2.7.4