aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2016-12-03 13:39:56 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2016-12-03 14:05:15 +0100
commite706e2e775730db5dfa9103628cd70704dd13cef (patch)
tree8b00cedf7292af06943bf61890abcb9fa09e3073
parent591c03242164fc5a9fe77fab47b5a68f4de1a135 (diff)
downloadffmpeg-e706e2e775730db5dfa9103628cd70704dd13cef.tar.gz
avformat/ffmdec: Check media type for chunks
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/ffmdec.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavformat/ffmdec.c b/libavformat/ffmdec.c
index a8c601b8b3..c76c3e5276 100644
--- a/libavformat/ffmdec.c
+++ b/libavformat/ffmdec.c
@@ -381,7 +381,7 @@ static int ffm2_read_header(AVFormatContext *s)
}
break;
case MKBETAG('S', 'T', 'V', 'I'):
- if (f_stvi++) {
+ if (f_stvi++ || codecpar->codec_type != AVMEDIA_TYPE_VIDEO) {
ret = AVERROR(EINVAL);
goto fail;
}
@@ -445,7 +445,7 @@ static int ffm2_read_header(AVFormatContext *s)
avio_rb32(pb); // refs
break;
case MKBETAG('S', 'T', 'A', 'U'):
- if (f_stau++) {
+ if (f_stau++ || codecpar->codec_type != AVMEDIA_TYPE_AUDIO) {
ret = AVERROR(EINVAL);
goto fail;
}
@@ -474,7 +474,7 @@ static int ffm2_read_header(AVFormatContext *s)
}
break;
case MKBETAG('S', '2', 'V', 'I'):
- if (f_stvi++ || !size) {
+ if (f_stvi++ || !size || codecpar->codec_type != AVMEDIA_TYPE_VIDEO) {
ret = AVERROR(EINVAL);
goto fail;
}
@@ -492,7 +492,7 @@ static int ffm2_read_header(AVFormatContext *s)
goto fail;
break;
case MKBETAG('S', '2', 'A', 'U'):
- if (f_stau++ || !size) {
+ if (f_stau++ || !size || codecpar->codec_type != AVMEDIA_TYPE_AUDIO) {
ret = AVERROR(EINVAL);
goto fail;
}