Commit bbe9a4b5 authored by Michael Niedermayer's avatar Michael Niedermayer

avformat/ffmdec: Check media type for chunks

Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit e706e2e7)
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent a772aaf5
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment