static void id3v2_read_ttag(AVFormatContext *s, int taglen, const char *key)
{
char *q, dst[512];
- int len, dstlen = sizeof(dst);
+ int len, dstlen = sizeof(dst) - 1;
unsigned genre;
- if(dstlen > 0)
- dst[0]= 0;
+ dst[0]= 0;
if(taglen < 1)
return;
taglen--; /* account for encoding type byte */
- dstlen--; /* Leave space for zero terminator */
switch(get_byte(s->pb)) { /* encoding type */
if (first_frames>=3) return AVPROBE_SCORE_MAX/2+1;
else if(max_frames>500)return AVPROBE_SCORE_MAX/2;
else if(max_frames>=3) return AVPROBE_SCORE_MAX/4;
+ else if(buf0!=p->buf) return AVPROBE_SCORE_MAX/4-1;
else if(max_frames>=1) return 1;
else return 0;
}
count++;
}
if ((tag = av_metadata_get(s->metadata, "genre", NULL, 0))) {
- for(i = 0; i <= ID3v1_GENRE_MAX; i++) {
- if (!strcasecmp(tag->value, id3v1_genre_str[i])) {
- buf[127] = i;
- count++;
- break;
+ for(i = 0; i <= ID3v1_GENRE_MAX; i++) {
+ if (!strcasecmp(tag->value, id3v1_genre_str[i])) {
+ buf[127] = i;
+ count++;
+ break;
+ }
}
}
- }
return count;
}