summaryrefslogtreecommitdiff
path: root/libavformat/id3v2.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-05-03 15:38:46 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-05-03 15:50:01 +0200
commit760f7d3a90bf4ab7ca396c62aa239b75c7ac6f59 (patch)
treeb6970fed9789f0e2d78a997dbf213e3ada29ef49 /libavformat/id3v2.c
parent0966623604a92bc7fa6213e7dfb9c03d007ab3e9 (diff)
parent769d921f3e4d3808320238f4f33b47cd492f1c04 (diff)
downloadffmpeg-760f7d3a90bf4ab7ca396c62aa239b75c7ac6f59.tar.gz
Merge remote-tracking branch 'qatar/master'
* qatar/master: compat: msvc: Make sure the object files are included when linking statically id3v2: check for end of file while unescaping tags Conflicts: configure libavformat/id3v2.c Note, ffmpeg is not affected by the out of buffer write bug Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/id3v2.c')
-rw-r--r--libavformat/id3v2.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libavformat/id3v2.c b/libavformat/id3v2.c
index 46d579f466..3b02f95553 100644
--- a/libavformat/id3v2.c
+++ b/libavformat/id3v2.c
@@ -720,9 +720,11 @@ static void id3v2_parse(AVFormatContext *s, int len, uint8_t version,
uint8_t *b;
b = buffer;
- while (avio_tell(s->pb) < end && b - buffer < tlen) {
+ while (avio_tell(s->pb) < end && b - buffer < tlen && !s->pb->eof_reached) {
*b++ = avio_r8(s->pb);
- if (*(b - 1) == 0xff && avio_tell(s->pb) < end - 1 && b - buffer < tlen) {
+ if (*(b - 1) == 0xff && avio_tell(s->pb) < end - 1 &&
+ b - buffer < tlen &&
+ !s->pb->eof_reached ) {
uint8_t val = avio_r8(s->pb);
*b++ = val ? val : avio_r8(s->pb);
}