[FFmpeg-devel,5/6] avformat/matroskadec: also check ff_webm_codec_tags for valid CodecIDs

Submitted by James Almer on Sept. 22, 2018, 12:41 a.m.

Details

Message ID 20180922004154.2884-1-jamrial@gmail.com
State New
Headers show

Commit Message

James Almer Sept. 22, 2018, 12:41 a.m.
Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavformat/matroskadec.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Patch hide | download patch | download mbox

diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index e6793988e1..16a326dff4 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -2188,6 +2188,14 @@  static int matroska_parse_tracks(AVFormatContext *s)
             }
         }
 
+        for (j = 0; ff_webm_codec_tags[j].id != AV_CODEC_ID_NONE; j++) {
+            if (!strncmp(ff_webm_codec_tags[j].str, track->codec_id,
+                         strlen(ff_webm_codec_tags[j].str))) {
+                codec_id = ff_webm_codec_tags[j].id;
+                break;
+            }
+        }
+
         for (j = 0; ff_mkv_codec_tags[j].id != AV_CODEC_ID_NONE; j++) {
             if (!strncmp(ff_mkv_codec_tags[j].str, track->codec_id,
                          strlen(ff_mkv_codec_tags[j].str))) {