Mercurial > libavformat.hg
comparison mp3.c @ 3539:4dee13c8073a libavformat
All id3 parsers are buggy, 0 termination fix 1 of n (issue created by andreas
and found by reimar) fix is from reimar + cosmetics by me.
author | michael |
---|---|
date | Fri, 04 Jul 2008 22:00:35 +0000 |
parents | 31a0f3b99ef7 |
children | 3dfb35d2ac51 |
comparison
equal
deleted
inserted
replaced
3538:e50efb387048 | 3539:4dee13c8073a |
---|---|
183 static void id3v2_read_ttag(AVFormatContext *s, int taglen, char *dst, int dstlen) | 183 static void id3v2_read_ttag(AVFormatContext *s, int taglen, char *dst, int dstlen) |
184 { | 184 { |
185 char *q; | 185 char *q; |
186 int len; | 186 int len; |
187 | 187 |
188 if(dstlen > 0) | |
189 dst[0]= 0; | |
188 if(taglen < 1) | 190 if(taglen < 1) |
189 return; | 191 return; |
190 | 192 |
191 taglen--; /* account for encoding type byte */ | 193 taglen--; /* account for encoding type byte */ |
192 dstlen--; /* Leave space for zero terminator */ | 194 dstlen--; /* Leave space for zero terminator */ |