Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2016-12-03 15:39:56 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2016-12-04 22:25:15 +0300
commit9f7eb718e9d345179283a1bbfee1d89a5e2d18bc (patch)
tree2a326883b12f7863000fd2aea97a78c34b5b96db
parent2d66fbc853ff7d22c30a597fe548e3ff952a1dc7 (diff)
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 83929fe8c3..44110af701 100644
--- a/libavformat/ffmdec.c
+++ b/libavformat/ffmdec.c
@@ -362,7 +362,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;
}
@@ -423,7 +423,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;
}
@@ -449,7 +449,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;
}
@@ -464,7 +464,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;
}