mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-03-17 20:17:55 +02:00
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>
This commit is contained in:
parent
2d66fbc853
commit
9f7eb718e9
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user