]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/riff.c
lavf: move ff_codec_get_tag() and ff_codec_get_id() definitions to internal.h
[ffmpeg] / libavformat / riff.c
index 11e2a6438f0a9e5e7d4d0541a24fed57eaba5779..fde11317fe62acf47f5dd2aadb63f4e2b9f3c260 100644 (file)
@@ -348,7 +348,6 @@ const AVCodecTag ff_codec_wav_tags[] = {
     // for NuppelVideo (nuv.c)
     { AV_CODEC_ID_PCM_S16LE, MKTAG('R', 'A', 'W', 'A') },
     { AV_CODEC_ID_MP3,       MKTAG('L', 'A', 'M', 'E') },
-    { AV_CODEC_ID_MP3,       MKTAG('M', 'P', '3', ' ') },
     { AV_CODEC_ID_NONE,      0 },
 };
 
@@ -726,13 +725,20 @@ int ff_read_riff_info(AVFormatContext *s, int64_t size)
 
         chunk_code = avio_rl32(pb);
         chunk_size = avio_rl32(pb);
+
         if (chunk_size > end || end - chunk_size < cur || chunk_size == UINT_MAX) {
-            av_log(s, AV_LOG_ERROR, "too big INFO subchunk\n");
-            return AVERROR_INVALIDDATA;
+            av_log(s, AV_LOG_WARNING, "too big INFO subchunk\n");
+            break;
         }
 
         chunk_size += (chunk_size & 1);
 
+        if (!chunk_code) {
+            if (chunk_size)
+                avio_skip(pb, chunk_size);
+            continue;
+        }
+
         value = av_malloc(chunk_size + 1);
         if (!value) {
             av_log(s, AV_LOG_ERROR, "out of memory, unable to read INFO tag\n");
@@ -743,8 +749,8 @@ int ff_read_riff_info(AVFormatContext *s, int64_t size)
 
         if (avio_read(pb, value, chunk_size) != chunk_size) {
             av_free(value);
-            av_log(s, AV_LOG_ERROR, "premature end of file while reading INFO tag\n");
-            return AVERROR_INVALIDDATA;
+            av_log(s, AV_LOG_WARNING, "premature end of file while reading INFO tag\n");
+            break;
         }
 
         value[chunk_size] = 0;