Commit ba93c3f6 authored by diego's avatar diego

id3v2: check for enough space to write full UTF-8 characters.

patch by Anton Khirnov, wyskas gmail com


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@20004 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent c2ca1c6e
...@@ -92,9 +92,9 @@ static void read_ttag(AVFormatContext *s, int taglen, const char *key) ...@@ -92,9 +92,9 @@ static void read_ttag(AVFormatContext *s, int taglen, const char *key)
case 0: /* ISO-8859-1 (0 - 255 maps directly into unicode) */ case 0: /* ISO-8859-1 (0 - 255 maps directly into unicode) */
q = dst; q = dst;
while (taglen--) { while (taglen-- && q - dst < dstlen - 7) {
uint8_t tmp; uint8_t tmp;
PUT_UTF8(get_byte(s->pb), tmp, if (q - dst < dstlen - 1) *q++ = tmp;) PUT_UTF8(get_byte(s->pb), tmp, *q++ = tmp;)
} }
*q = '\0'; *q = '\0';
break; break;
......
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