aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/id3v2.c
diff options
context:
space:
mode:
authorAnton Khirnov <wyskas@gmail.com>2009-09-23 18:04:40 +0000
committerDiego Biurrun <diego@biurrun.de>2009-09-23 18:04:40 +0000
commit787f8fad00c66fc225662f7defb90e79c112ed40 (patch)
treeb59f1b479f6167358a12a7e67e4fb02ee2b5344b /libavformat/id3v2.c
parentc31afa5d245f263fe5be5b2bff31efe6a71f406f (diff)
downloadffmpeg-787f8fad00c66fc225662f7defb90e79c112ed40.tar.gz
id3v2: check for enough space to write full UTF-8 characters.
patch by Anton Khirnov, wyskas gmail com Originally committed as revision 20004 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/id3v2.c')
-rw-r--r--libavformat/id3v2.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/id3v2.c b/libavformat/id3v2.c
index 0cf2cb1a07..8070a4a34d 100644
--- a/libavformat/id3v2.c
+++ b/libavformat/id3v2.c
@@ -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) */
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;