[FFmpeg-cvslog] r20004 - trunk/libavformat/id3v2.c
diego
subversion
Wed Sep 23 20:04:41 CEST 2009
Author: diego
Date: Wed Sep 23 20:04:40 2009
New Revision: 20004
Log:
id3v2: check for enough space to write full UTF-8 characters.
patch by Anton Khirnov, wyskas gmail com
Modified:
trunk/libavformat/id3v2.c
Modified: trunk/libavformat/id3v2.c
==============================================================================
--- trunk/libavformat/id3v2.c Wed Sep 23 17:30:38 2009 (r20003)
+++ trunk/libavformat/id3v2.c Wed Sep 23 20:04:40 2009 (r20004)
@@ -92,9 +92,9 @@ static void read_ttag(AVFormatContext *s
case 0: /* ISO-8859-1 (0 - 255 maps directly into unicode) */
q = dst;
- while (taglen--) {
+ while (taglen-- && q - dst < dstlen - 7) {
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';
break;
More information about the ffmpeg-cvslog
mailing list