riff: do not add empty metadata tags in INFO chunk
authorJustin Ruggles <justin.ruggles@gmail.com>
Sun, 25 Nov 2012 17:40:54 +0000 (12:40 -0500)
committerJustin Ruggles <justin.ruggles@gmail.com>
Tue, 27 Nov 2012 00:08:51 +0000 (19:08 -0500)
libavformat/riff.c

index 731309201a1c165acb6e2f62246e2b72b4f8a1bc..190504cc7963cc7da446567f8cd0aab1d1f3f046 100644 (file)
@@ -734,6 +734,12 @@ int ff_read_riff_info(AVFormatContext *s, int64_t size)
 
         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");