OSDN Git Service

avformat/id3v2: Check avio_read() return value in read_chapter()
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 15 Dec 2013 19:57:19 +0000 (20:57 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 15 Dec 2013 21:11:28 +0000 (22:11 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/id3v2.c

index effaaf4..6c82632 100644 (file)
@@ -544,7 +544,8 @@ static void read_chapter(AVFormatContext *s, AVIOContext *pb, int len, char *tta
 
     len -= 16;
     while (len > 10) {
-        avio_read(pb, tag, 4);
+        if (avio_read(pb, tag, 4) < 4)
+            goto end;
         tag[4] = 0;
         taglen = avio_rb32(pb);
         avio_skip(pb, 2);