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-06 00:07:50 +0100
commitbbe9a4b54263f59b0b88e3f18369889ceed7a57a (patch)
treed7c09195625cfe94b2e1f7714bacd561c3304b3e
parenta772aaf5dc76605666404acc80ddd4fae17ca9f6 (diff)
downloadffmpeg-bbe9a4b54263f59b0b88e3f18369889ceed7a57a.tar.gz
avformat/ffmdec: Check media type for chunks
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit e706e2e775730db5dfa9103628cd70704dd13cef) 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 960e793220..08f1fbe9b7 100644
--- a/libavformat/ffmdec.c
+++ b/libavformat/ffmdec.c
@@ -388,7 +388,7 @@ static int ffm2_read_header(AVFormatContext *s)
}
break;
case MKBETAG('S', 'T', 'V', 'I'):
- if (f_stvi++) {
+ if (f_stvi++ || codec->codec_type != AVMEDIA_TYPE_VIDEO) {
ret = AVERROR(EINVAL);
goto fail;
}
@@ -452,7 +452,7 @@ static int ffm2_read_header(AVFormatContext *s)
codec->refs = avio_rb32(pb);
break;
case MKBETAG('S', 'T', 'A', 'U'):
- if (f_stau++) {
+ if (f_stau++ || codec->codec_type != AVMEDIA_TYPE_AUDIO) {
ret = AVERROR(EINVAL);
goto fail;
}
@@ -481,7 +481,7 @@ static int ffm2_read_header(AVFormatContext *s)
}
break;
case MKBETAG('S', '2', 'V', 'I'):
- if (f_stvi++ || !size) {
+ if (f_stvi++ || !size || codec->codec_type != AVMEDIA_TYPE_VIDEO) {
ret = AVERROR(EINVAL);
goto fail;
}
@@ -496,7 +496,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 || codec->codec_type != AVMEDIA_TYPE_AUDIO) {
ret = AVERROR(EINVAL);
goto fail;
}