Browse Source

avformat/id3v2: Check avio_read() return value in read_chapter()

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Michael Niedermayer 11 years ago
parent
commit
ffbcb1c6f0
1 changed files with 2 additions and 1 deletions
  1. 2 1
      libavformat/id3v2.c

+ 2 - 1
libavformat/id3v2.c

@@ -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);