From da478aaa3237b691dfaa4676eb384fc64349e8ea Mon Sep 17 00:00:00 2001 From: Roman Artiukhin Date: Thu, 7 Nov 2024 11:12:01 +0200 Subject: [PATCH] metadata: mp3: Simplify comment tag processing Avoid unnecessary string comparison. Change-Id: Ib1c5622f7b7760c43c4763930dc4ef6b409dbc05 --- lib/rbcodec/metadata/id3tags.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/rbcodec/metadata/id3tags.c b/lib/rbcodec/metadata/id3tags.c index bc811cc013..506cbcaaf1 100644 --- a/lib/rbcodec/metadata/id3tags.c +++ b/lib/rbcodec/metadata/id3tags.c @@ -996,8 +996,7 @@ retry_with_limit: * remove them so unicode_munge can work correctly */ - if((tr->tag_length == 4 && !memcmp( header, "COMM", 4)) || - (tr->tag_length == 3 && !memcmp( header, "COM", 3))) { + if (tr->offset == offsetof(struct mp3entry, comment)) { int offset; if (buffersize - bufferpos <= 4) return; /* Error ?? */