]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/nsvdec.c
avformat/libopenmpt: Query duration and metadata after selecting subsong
[ffmpeg] / libavformat / nsvdec.c
index c6ddb67bbddcb7797844f3c5f5dfb08105396804..d8ce656817cab7009362d692fee25d14d006f772 100644 (file)
@@ -335,8 +335,11 @@ static int nsv_parse_NSVf_header(AVFormatContext *s)
         if (!nsv->nsvs_file_offset)
             return AVERROR(ENOMEM);
 
-        for(i=0;i<table_entries_used;i++)
+        for(i=0;i<table_entries_used;i++) {
+            if (avio_feof(pb))
+                return AVERROR_INVALIDDATA;
             nsv->nsvs_file_offset[i] = avio_rl32(pb) + size;
+        }
 
         if(table_entries > table_entries_used &&
            avio_rl32(pb) == MKTAG('T','O','C','2')) {