File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -69,7 +69,11 @@ class MetaDataID3Base {
69
69
70
70
// / find the tag position in the string - if not found we return -1;
71
71
int findTag (const char * tag, const char *str, size_t len){
72
- if (len>1600 || str==nullptr || len<=0 ) return -1 ;
72
+ if (str==nullptr || len<=0 ) return -1 ;
73
+ // The tags are usally in the first 500 bytes - we limit the search
74
+ if (len>1600 ){
75
+ len = 1600 ;
76
+ }
73
77
size_t tag_len = strlen (tag);
74
78
for (size_t j=0 ;j<=len-tag_len-1 ;j++){
75
79
if (memcmp (str+j,tag, tag_len)==0 ){
@@ -422,8 +426,10 @@ class MetaDataID3V2 : public MetaDataID3Base {
422
426
int l = min (calcSize (frame_header.size )-1 , (uint32_t ) 256 );
423
427
memset (result,0 ,256 );
424
428
strncpy ((char *)result, (char *) data+tag_pos+ID3FrameSize, l);
425
- if (isAscii (l))
429
+ int checkLen = min (l, 10 );
430
+ if (isAscii (checkLen)){
426
431
processNotify ();
432
+ }
427
433
} else {
428
434
partial_tag = tag;
429
435
}
You can’t perform that action at this time.
0 commit comments