Revision 3b1c4a06

View differences:

libavformat/mp3.c
170 170
static void id3v2_read_ttag(AVFormatContext *s, int taglen, const char *key)
171 171
{
172 172
    char *q, dst[512];
173
    int len, dstlen = sizeof(dst);
173
    int len, dstlen = sizeof(dst) - 1;
174 174
    unsigned genre;
175 175

  
176
    if(dstlen > 0)
177 176
        dst[0]= 0;
178 177
    if(taglen < 1)
179 178
        return;
180 179

  
181 180
    taglen--; /* account for encoding type byte */
182
    dstlen--; /* Leave space for zero terminator */
183 181

  
184 182
    switch(get_byte(s->pb)) { /* encoding type */
185 183

  

Also available in: Unified diff