Commit 64b48f61 authored by schreibfaul1's avatar schreibfaul1

ignore large VORBIS comments

parent dbeb2d03
......@@ -1563,10 +1563,11 @@ int Audio::read_FLAC_Header(uint8_t* data, size_t len) {
(void)i;
size_t commentLength = data[0] + (data[1] << 8) + (data[2] << 16) + (data[3] << 24);
data += 4; idx += 4;
if(commentLength > 512) commentLength = 512; // guard
strncpy(m_chbuf, (const char *)data , commentLength);
m_chbuf[commentLength] = '\0';
if(audio_id3data) audio_id3data(m_chbuf);
if(commentLength < 512) { // guard
strncpy(m_chbuf, (const char *)data , commentLength);
m_chbuf[commentLength] = '\0';
if(audio_id3data) audio_id3data(m_chbuf);
}
data += commentLength; idx += commentLength;
if(idx > vendorLength + 3) {log_e("VORBIS COMMENT section is too long");}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment