Skip to content

Commit 309bac8

Browse files
committed
MetaDataID3 some more checks
1 parent 69ed052 commit 309bac8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/AudioTools/CoreAudio/AudioMetaData/MetaDataID3.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,13 @@ class MetaDataID3Base {
8080

8181
/// find the tag position in the string - if not found we return -1;
8282
int findTag(const char* tag, const char*str, size_t len){
83-
if (str==nullptr || len<=0) return -1;
83+
if (tag==nullptr || str==nullptr || len<=0) return -1;
8484
// The tags are usally in the first 500 bytes - we limit the search
8585
if (len>1600){
8686
len = 1600;
8787
}
8888
size_t tag_len = strlen(tag);
89+
if (tag_len >= len) return -1;
8990
for (size_t j=0;j<=len-tag_len-1;j++){
9091
if (memcmp(str+j,tag, tag_len)==0){
9192
return j;

0 commit comments

Comments
 (0)