diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-12-15 20:12:48 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-12-15 20:13:45 +0100 |
commit | 476aceaa22a0f68d69fe8477f9ee98bf212d222c (patch) | |
tree | 805707ae2adea434d1d6b6048848461de84067f5 /libavformat/id3v2.c | |
parent | b2a4316287ea814168b0b794bd7ab0063fd1dd0f (diff) | |
download | ffmpeg-476aceaa22a0f68d69fe8477f9ee98bf212d222c.tar.gz |
vformat/id3v2: check avio_read for short reads in addition to errors
Found-by: ubitux
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/id3v2.c')
-rw-r--r-- | libavformat/id3v2.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/id3v2.c b/libavformat/id3v2.c index 5f5ccb6322..c2bd56ff46 100644 --- a/libavformat/id3v2.c +++ b/libavformat/id3v2.c @@ -667,7 +667,7 @@ static void id3v2_parse(AVFormatContext *s, int len, uint8_t version, unsigned long dlen; if (isv34) { - if (avio_read(s->pb, tag, 4) < 0) + if (avio_read(s->pb, tag, 4) < 4) break; tag[4] = 0; if (version == 3) { @@ -677,7 +677,7 @@ static void id3v2_parse(AVFormatContext *s, int len, uint8_t version, tflags = avio_rb16(s->pb); tunsync = tflags & ID3v2_FLAG_UNSYNCH; } else { - if (avio_read(s->pb, tag, 3) < 0) + if (avio_read(s->pb, tag, 3) < 3) break; tag[3] = 0; tlen = avio_rb24(s->pb); |